From 95c7d5a8c9fc4c4d6326d608723237ed197b893a Mon Sep 17 00:00:00 2001 From: pdabade Date: Tue, 10 Dec 2013 10:42:01 +0530 Subject: 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 Reviewed-on: http://git-master/r/340236 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Jong Kim Reviewed-by: Jon Mayo Reviewed-by: Matthew Pedro --- drivers/video/tegra/dc/hdmi.c | 5 +++-- 1 file 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 * - * 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)) -- cgit v1.2.3