Skip to content

Commit

Permalink
video: s3c-fb: fix possible division by zero in s3c_fb_calc_pixclk
Browse files Browse the repository at this point in the history
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 <jg1.han@samsung.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
  • Loading branch information
Jingoo Han authored and Florian Tobias Schandinat committed Jun 13, 2012
1 parent ecd57ae commit b679895
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/video/s3c-fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit b679895

Please sign in to comment.