From: Jingoo Han Date: Mon, 11 Jun 2012 02:27:27 +0000 (+0900) Subject: video: s3c-fb: fix possible division by zero in s3c_fb_calc_pixclk X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=b67989515defba7412acff01162e5bb1f0f5923a;p=openwrt%2Fstaging%2Fblogic.git video: s3c-fb: fix possible division by zero in s3c_fb_calc_pixclk Divider value can be zero and it makes division by zero from debug message in s3c_fb_calc_pixclk; therefore, it should be fixed. Signed-off-by: Jingoo Han Signed-off-by: Florian Tobias Schandinat --- diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c index b5c29399a5ee..ea7b661e7229 100644 --- a/drivers/video/s3c-fb.c +++ b/drivers/video/s3c-fb.c @@ -361,7 +361,7 @@ static int s3c_fb_calc_pixclk(struct s3c_fb *sfb, unsigned int pixclk) result = (unsigned int)tmp / 1000; dev_dbg(sfb->dev, "pixclk=%u, clk=%lu, div=%d (%lu)\n", - pixclk, clk, result, clk / result); + pixclk, clk, result, result ? clk / result : clk); return result; }