All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 6/10] fbdev: Initialize var structure in calc_mode_timings
@ 2005-09-01 21:39 Antonino A. Daplas
  0 siblings, 0 replies; only message in thread
From: Antonino A. Daplas @ 2005-09-01 21:39 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Linux Fbdev development list

    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>

---
 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, 




-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-09-01 21:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-01 21:39 [PATCH 6/10] fbdev: Initialize var structure in calc_mode_timings Antonino A. Daplas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.