tree 4140b59ec3882a954b620ebbee56d6c7bcdf781d
parent 7c1cd6fd5efeb95603e37f35b5da293b452d8b64
author Antonino A. Daplas <[EMAIL PROTECTED]> Sat, 10 Sep 2005 03:10:02 -0700
committer Linus Torvalds <[EMAIL PROTECTED]> Sat, 10 Sep 2005 04:03:40 -0700

[PATCH] fbdev: Initialize var structure in calc_mode_timings

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 <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>

 drivers/video/fbmon.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/video/fbmon.c b/drivers/video/fbmon.c
--- a/drivers/video/fbmon.c
+++ b/drivers/video/fbmon.c
@@ -314,11 +314,13 @@ static int edid_is_monitor_block(unsigne
                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, 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to