From 17de002a0ff09138c9db244cb200380ba38f4033 Mon Sep 17 00:00:00 2001 From: Donghan Ryu Date: Mon, 28 Mar 2011 12:10:53 +0900 Subject: tegra: display: fb: fixing uninitialized values fb_videomode_to_var doesn't fill out all the members of fb_var_screeninfo. So, we need to perform memset before calling the function Bug 808273 Change-Id: I162ea2093262f074dcf5f917b40a5bbf4c79c34d Reviewed-on: http://git-master/r/24430 Tested-by: Donghan Ryu Reviewed-by: Jinyoung Park Reviewed-by: Jubeom Kim Reviewed-by: Jessica Liao Tested-by: Jessica Liao Reviewed-by: Min-wuk Lee Reviewed-by: Bharat Nihalani --- drivers/video/tegra/fb.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/video/tegra/fb.c b/drivers/video/tegra/fb.c index d22603f7e2bd..e64039a7743c 100644 --- a/drivers/video/tegra/fb.c +++ b/drivers/video/tegra/fb.c @@ -603,6 +603,11 @@ static int tegra_fb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long if (i >= modedb.modedb_len) break; + + /* fb_videomode_to_var doesn't fill out all the members + of fb_var_screeninfo */ + memset(&var, 0x0, sizeof(var)); + fb_videomode_to_var(&var, &modelist->mode); if (copy_to_user((void __user *)&modedb.modedb[i], @@ -698,6 +703,10 @@ void tegra_fb_update_monspecs(struct tegra_fb_info *fb_info, fb_info->info->mode = (struct fb_videomode *) fb_find_best_display(specs, &fb_info->info->modelist); + /* fb_videomode_to_var doesn't fill out all the members + of fb_var_screeninfo */ + memset(&fb_info->info->var, 0x0, sizeof(fb_info->info->var)); + fb_videomode_to_var(&fb_info->info->var, fb_info->info->mode); tegra_fb_set_par(fb_info->info); } -- cgit v1.2.3