* [PATCH 2/2] video: s3c-fb: fix possible division by zero in s3c_fb_calc_pixclk
@ 2012-06-11 2:27 Jingoo Han
0 siblings, 0 replies; only message in thread
From: Jingoo Han @ 2012-06-11 2:27 UTC (permalink / raw)
To: linux-fbdev
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>
---
drivers/video/s3c-fb.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
index b5c2939..ea7b661 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;
}
--
1.7.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2012-06-11 2:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-11 2:27 [PATCH 2/2] video: s3c-fb: fix possible division by zero in s3c_fb_calc_pixclk Jingoo Han
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox