]> Git Repo - linux.git/commitdiff
drm/ssd130x: Fix possible uninitialized usage of crtc_state variable
authorJavier Martinez Canillas <[email protected]>
Fri, 20 Oct 2023 22:52:57 +0000 (00:52 +0200)
committerJavier Martinez Canillas <[email protected]>
Mon, 30 Oct 2023 10:00:27 +0000 (11:00 +0100)
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 <[email protected]>
Closes: https://lore.kernel.org/dri-devel/[email protected]/
Signed-off-by: Javier Martinez Canillas <[email protected]>
Acked-by: Jocelyn Falempe <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
(cherry picked from commit 9e4db199e66d427c50458f4d72734cc4f0b92948)
Signed-off-by: Javier Martinez Canillas <[email protected]>
drivers/gpu/drm/solomon/ssd130x.c

index 32f0857aec9f195e94b6fbd55cd9bd15776525a7..e0174f82e353718507bc46dd31d2fa75e01c2626 100644 (file)
@@ -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;
This page took 0.057921 seconds and 4 git commands to generate.