Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fbdev: au1100fb: Move a variable assignment behind a null pointer check

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>

authored by

Markus Elfring and committed by
Helge Deller
2df2c0ca b347f457

+3 -1
+3 -1
drivers/video/fbdev/au1100fb.c
··· 137 137 */ 138 138 int au1100fb_setmode(struct au1100fb_device *fbdev) 139 139 { 140 - struct fb_info *info = &fbdev->info; 140 + struct fb_info *info; 141 141 u32 words; 142 142 int index; 143 143 144 144 if (!fbdev) 145 145 return -EINVAL; 146 + 147 + info = &fbdev->info; 146 148 147 149 /* Update var-dependent FB info */ 148 150 if (panel_is_active(fbdev->panel) || panel_is_color(fbdev->panel)) {