Thread (2 messages) 2 messages, 2 authors, 2012-08-23

Re: [patch] video: mb862xxfb: prevent divide by zero bug

From: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Date: 2012-08-23 20:30:43
Also in: kernel-janitors

On 08/18/2012 03:55 PM, Dan Carpenter wrote:
Do a sanity check on these before using them as divisors.

Signed-off-by: Dan Carpenter <redacted>
Applied.


Thanks,

Florian Tobias Schandinat
quoted hunk ↗ jump to hunk
diff --git a/drivers/video/mb862xx/mb862xxfbdrv.c b/drivers/video/mb862xx/mb862xxfbdrv.c
index 00ce1f3..57d940b 100644
--- a/drivers/video/mb862xx/mb862xxfbdrv.c
+++ b/drivers/video/mb862xx/mb862xxfbdrv.c
@@ -328,6 +328,8 @@ static int mb862xxfb_ioctl(struct fb_info *fbi, unsigned int cmd,
 	case MB862XX_L1_SET_CFG:
 		if (copy_from_user(l1_cfg, argp, sizeof(*l1_cfg)))
 			return -EFAULT;
+		if (l1_cfg->dh = 0 || l1_cfg->dw = 0)
+			return -EINVAL;
 		if ((l1_cfg->sw >= l1_cfg->dw) && (l1_cfg->sh >= l1_cfg->dh)) {
 			/* downscaling */
 			outreg(cap, GC_CAP_CSC,
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help