]> www.infradead.org Git - users/jedix/linux-maple.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)
committerHelge Deller <deller@gmx.de>
Wed, 26 Mar 2025 21:39:20 +0000 (22:39 +0100)
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>
drivers/video/fbdev/au1100fb.c

index 840f221607635bfe3c8a9860ede7ebd2004cc7a6..6251a6b07b3a11a5e7478d482735a0d161cad5ee 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) {