提交 25682362 编写于 作者: D Dan Carpenter 提交者: Florian Tobias Schandinat

video: mb862xxfb: prevent divide by zero bug

Do a sanity check on these before using them as divisors.
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Acked-by: NAnatolij Gustschin <agust@denx.de>
Signed-off-by: NFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
上级 01817d19
......@@ -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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册