Commit b6798951 authored by Jingoo Han's avatar Jingoo Han Committed by Florian Tobias Schandinat

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: default avatarJingoo Han <jg1.han@samsung.com>
Signed-off-by: default avatarFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
parent ecd57ae2
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment