dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/ssd130x: Fix possible uninitialized usage of crtc_state variable
@ 2023-10-20 22:52 Javier Martinez Canillas
  2023-10-27  8:21 ` Jocelyn Falempe
  0 siblings, 1 reply; 10+ messages in thread
From: Javier Martinez Canillas @ 2023-10-20 22:52 UTC (permalink / raw)
  To: linux-kernel
  Cc: Thomas Zimmermann, Javier Martinez Canillas, Maxime Ripard,
	dri-devel, Dan Carpenter

Avoid a possible uninitialized use of the crtc_state variable in function
ssd132x_primary_plane_atomic_check() and avoid the following Smatch warn:

    drivers/gpu/drm/solomon/ssd130x.c:921 ssd132x_primary_plane_atomic_check()
    error: uninitialized symbol 'crtc_state'.

Fixes: fdd591e00a9c ("drm/ssd130x: Add support for the SSD132x OLED controller family")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/dri-devel/7dd6ca45-8263-44fe-a318-2fd9d761425d@moroto.mountain/
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---

 drivers/gpu/drm/solomon/ssd130x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/solomon/ssd130x.c b/drivers/gpu/drm/solomon/ssd130x.c
index 32f0857aec9f..e0174f82e353 100644
--- a/drivers/gpu/drm/solomon/ssd130x.c
+++ b/drivers/gpu/drm/solomon/ssd130x.c
@@ -910,7 +910,7 @@ static int ssd132x_primary_plane_atomic_check(struct drm_plane *plane,
 	struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(state, plane);
 	struct ssd130x_plane_state *ssd130x_state = to_ssd130x_plane_state(plane_state);
 	struct drm_crtc *crtc = plane_state->crtc;
-	struct drm_crtc_state *crtc_state;
+	struct drm_crtc_state *crtc_state = NULL;
 	const struct drm_format_info *fi;
 	unsigned int pitch;
 	int ret;
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-10-31 13:52 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-20 22:52 [PATCH] drm/ssd130x: Fix possible uninitialized usage of crtc_state variable Javier Martinez Canillas
2023-10-27  8:21 ` Jocelyn Falempe
2023-10-27  9:31   ` Javier Martinez Canillas
2023-10-31  9:56     ` Geert Uytterhoeven
2023-10-31 10:11       ` Javier Martinez Canillas
2023-10-31 10:31         ` Geert Uytterhoeven
2023-10-31 11:27           ` Javier Martinez Canillas
2023-10-31 11:53             ` Maxime Ripard
2023-10-31 13:00               ` Geert Uytterhoeven
2023-10-31 13:52                 ` Maxime Ripard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).