Skip to content

Commit 2df2c0c

Browse files
elfringhdeller
authored andcommitted
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: 3b495f2 ("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>
1 parent b347f45 commit 2df2c0c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/video/fbdev/au1100fb.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,15 @@ static int au1100fb_fb_blank(int blank_mode, struct fb_info *fbi)
137137
*/
138138
int au1100fb_setmode(struct au1100fb_device *fbdev)
139139
{
140-
struct fb_info *info = &fbdev->info;
140+
struct fb_info *info;
141141
u32 words;
142142
int index;
143143

144144
if (!fbdev)
145145
return -EINVAL;
146146

147+
info = &fbdev->info;
148+
147149
/* Update var-dependent FB info */
148150
if (panel_is_active(fbdev->panel) || panel_is_color(fbdev->panel)) {
149151
if (info->var.bits_per_pixel <= 8) {

0 commit comments

Comments
 (0)