diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2012-08-18 18:55:41 +0300 |
---|---|---|
committer | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2012-08-23 12:34:00 +0000 |
commit | 25682362564fa0c950d9afe798def2ec9c3676a2 (patch) | |
tree | 5881de8390fe8200664160ba7baf20d882b9538c /drivers/video/mb862xx | |
parent | 01817d194a5c078696ac4a31b5d8b99a6a9e40c7 (diff) |
video: mb862xxfb: prevent divide by zero bug
Do a sanity check on these before using them as divisors.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Diffstat (limited to 'drivers/video/mb862xx')
-rw-r--r-- | drivers/video/mb862xx/mb862xxfbdrv.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/video/mb862xx/mb862xxfbdrv.c b/drivers/video/mb862xx/mb862xxfbdrv.c index 00ce1f34b496..57d940be5f3d 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, |