summaryrefslogtreecommitdiff
path: root/drivers/video/tegra
diff options
context:
space:
mode:
authorpdabade <pdabade@nvidia.com>2013-12-10 10:42:01 +0530
committerMatthew Pedro <mapedro@nvidia.com>2014-01-24 12:01:42 -0800
commit95c7d5a8c9fc4c4d6326d608723237ed197b893a (patch)
tree4b044ee1b24fb3c66723c8b21acc14753db9b8ce /drivers/video/tegra
parentd633a68ac0c4758927bc436142c196421287d10a (diff)
video: tegra: hdmi: validate variable screeninfo
verify variable screeninfo by checking xres and yres before validating aspect ratio. bug 1417318 Change-Id: I473f3e2f30888c053ca53559e33355f216d2a8d3 Signed-off-by: Pankaj Dabade <pdabade@nvidia.com> Reviewed-on: http://git-master/r/340236 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Jong Kim <jongk@nvidia.com> Reviewed-by: Jon Mayo <jmayo@nvidia.com> Reviewed-by: Matthew Pedro <mapedro@nvidia.com>
Diffstat (limited to 'drivers/video/tegra')
-rw-r--r--drivers/video/tegra/dc/hdmi.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/video/tegra/dc/hdmi.c b/drivers/video/tegra/dc/hdmi.c
index 55d9163d4faf..f3fcf2e2ee09 100644
--- a/drivers/video/tegra/dc/hdmi.c
+++ b/drivers/video/tegra/dc/hdmi.c
@@ -4,7 +4,7 @@
* Copyright (C) 2010 Google, Inc.
* Author: Erik Gilling <konkers@android.com>
*
- * Copyright (c) 2010-2012, NVIDIA CORPORATION, All rights reserved.
+ * Copyright (c) 2010-2013, NVIDIA CORPORATION, All rights reserved.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
@@ -1259,7 +1259,8 @@ static bool tegra_dc_hdmi_valid_asp_ratio(const struct tegra_dc *dc,
int s_aspratio = 0;
/* To check the aspect upto two decimal digits, calculate in % */
- m_aspratio = (mode->xres*100 / mode->yres);
+ if (mode->yres)
+ m_aspratio = (mode->xres*100 / mode->yres);
if ((m_aspratio < TEGRA_DC_HDMI_MIN_ASPECT_RATIO_PERCENT) ||
(m_aspratio > TEGRA_DC_HDMI_MAX_ASPECT_RATIO_PERCENT))