summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonghan Ryu <dryu@nvidia.com>2011-03-28 12:10:53 +0900
committerNiket Sirsi <nsirsi@nvidia.com>2011-04-05 18:44:03 -0700
commit23c22c320a77684dedb22b37b5f1d33780500fff (patch)
tree068609ca4f69b381c602f297d2d202e491b4c697
parent54ac4f377623e82cc7e1721f3c136dc41e93c34d (diff)
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 Reviewed-on: http://git-master/r/24430 (cherry picked from commit 17de002a0ff09138c9db244cb200380ba38f4033) Change-Id: Id4d2975fa2b887e97601f1aee8304465aecc7cc2 Reviewed-on: http://git-master/r/26669 Reviewed-by: Donghan Ryu <dryu@nvidia.com> Tested-by: Donghan Ryu <dryu@nvidia.com> Reviewed-by: Jubeom Kim <jubeomk@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
-rw-r--r--drivers/video/tegra/fb.c9
1 files changed, 9 insertions, 0 deletions
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);
}