From 2764083d283ec60a63a00519bae85be93067ce1a Mon Sep 17 00:00:00 2001 From: Huaibin Yang Date: Tue, 4 Sep 2012 13:31:29 -0700 Subject: [PATCH] msm_fb: display: fix division-by-zero bug Panel v_back_porch could be zero for virtual panels, so the check for zero is added to fix the bug. Change-Id: I6a29f3d8d771092bca2374cc9a1c11dd77ad569e Signed-off-by: Huaibin Yang --- drivers/video/msm/mdp4_overlay.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/video/msm/mdp4_overlay.c b/drivers/video/msm/mdp4_overlay.c index 11eaa9f13d61..d338946b4be1 100644 --- a/drivers/video/msm/mdp4_overlay.c +++ b/drivers/video/msm/mdp4_overlay.c @@ -2616,7 +2616,8 @@ static int mdp4_calc_pipe_mdp_clk(struct msm_fb_data_type *mfd, * required(FIR). */ if ((mfd->panel_info.lcdc.v_back_porch <= 4) && - (pipe->src_h != pipe->dst_h)) { + (pipe->src_h != pipe->dst_h) && + (mfd->panel_info.lcdc.v_back_porch)) { u32 clk = 0; clk = 4 * (pclk >> shift) / mfd->panel_info.lcdc.v_back_porch; clk <<= shift;