Skip to content

Commit

Permalink
[PATCH] fbdev: Initialize var structure in calc_mode_timings
Browse files Browse the repository at this point in the history
The var structure in calc_mode_timings is not properly initialized (zero set)
which leads to undefined behavior when it is passed to fb_get_mode().

Signed-off-by: Antonino Daplas <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Antonino A. Daplas authored and Linus Torvalds committed Sep 9, 2005
1 parent 7c1cd6f commit 61ab790
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/video/fbmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,11 +314,13 @@ static int edid_is_monitor_block(unsigned char *block)
return 0;
}

static void calc_mode_timings(int xres, int yres, int refresh, struct fb_videomode *mode)
static void calc_mode_timings(int xres, int yres, int refresh,
struct fb_videomode *mode)
{
struct fb_var_screeninfo var;
struct fb_info info;

memset(&var, 0, sizeof(struct fb_var_screeninfo));
var.xres = xres;
var.yres = yres;
fb_get_mode(FB_VSYNCTIMINGS | FB_IGNOREMON,
Expand Down

0 comments on commit 61ab790

Please sign in to comment.