]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
fbdev: au1100fb: Move a variable assignment behind a null pointer check
authorMarkus Elfring <elfring@users.sourceforge.net>
Thu, 13 Apr 2023 19:35:36 +0000 (21:35 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:30:57 +0000 (14:30 +0200)
[ Upstream commit 2df2c0caaecfd869b49e14f2b8df822397c5dd7f ]

The address of a data structure member was determined before
a corresponding null pointer check in the implementation of
the function “au1100fb_setmode”.

This issue was detected by using the Coccinelle software.

Fixes: 3b495f2bb749 ("Au1100 FB driver uplift for 2.6.")
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Acked-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/video/fbdev/au1100fb.c

index 37a6512feda0fb2042e8fe3676cc545de4a2ee36..abb769824840eb0fc3466e381732fc93dd9d21c6 100644 (file)
@@ -137,13 +137,15 @@ static int au1100fb_fb_blank(int blank_mode, struct fb_info *fbi)
         */
 int au1100fb_setmode(struct au1100fb_device *fbdev)
 {
-       struct fb_info *info = &fbdev->info;
+       struct fb_info *info;
        u32 words;
        int index;
 
        if (!fbdev)
                return -EINVAL;
 
+       info = &fbdev->info;
+
        /* Update var-dependent FB info */
        if (panel_is_active(fbdev->panel) || panel_is_color(fbdev->panel)) {
                if (info->var.bits_per_pixel <= 8) {