summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonghan Ryu <dryu@nvidia.com>2011-03-28 12:10:53 +0900
committerVarun Colbert <vcolbert@nvidia.com>2011-03-29 15:36:53 -0700
commit17de002a0ff09138c9db244cb200380ba38f4033 (patch)
tree1320f56fb2da0e56b3dc7be7ef6ed65526016ea1
parent68f192d4ce726a12f38b6d608e845e84a901b317 (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 Change-Id: I162ea2093262f074dcf5f917b40a5bbf4c79c34d Reviewed-on: http://git-master/r/24430 Tested-by: Donghan Ryu <dryu@nvidia.com> Reviewed-by: Jinyoung Park <jinyoungp@nvidia.com> Reviewed-by: Jubeom Kim <jubeomk@nvidia.com> Reviewed-by: Jessica Liao <jeliao@nvidia.com> Tested-by: Jessica Liao <jeliao@nvidia.com> Reviewed-by: Min-wuk Lee <mlee@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);
}