aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_crtc.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2014-09-16 11:28:52 +1000
committerDave Airlie <airlied@redhat.com>2014-09-16 11:38:04 +1000
commitb2efb3f0a1db62aff5e824125785ec6731143b6d (patch)
tree67510cec69e18e55d82bed803428b2a5027d92bb /drivers/gpu/drm/drm_crtc.c
parentMerge branch 'linux-3.18' of git://anongit.freedesktop.org/git/nouveau/linux-2.6 into drm-next (diff)
parentLinux 3.17-rc5 (diff)
downloadlinux-dev-b2efb3f0a1db62aff5e824125785ec6731143b6d.tar.xz
linux-dev-b2efb3f0a1db62aff5e824125785ec6731143b6d.zip
drm: backmerge tag 'v3.17-rc5' into drm-next
This is requested to get the fixes for intel and radeon into the same tree for future development work. i915_display.c: fix missing dev_priv conflict.
Diffstat (limited to 'drivers/gpu/drm/drm_crtc.c')
-rw-r--r--drivers/gpu/drm/drm_crtc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 0acb2de8e66e..ecd4e0b4c525 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -4731,8 +4731,9 @@ int drm_mode_create_dumb_ioctl(struct drm_device *dev,
return -EINVAL;
/* overflow checks for 32bit size calculations */
+ /* NOTE: DIV_ROUND_UP() can overflow */
cpp = DIV_ROUND_UP(args->bpp, 8);
- if (cpp > 0xffffffffU / args->width)
+ if (!cpp || cpp > 0xffffffffU / args->width)
return -EINVAL;
stride = cpp * args->width;
if (args->height > 0xffffffffU / stride)