summaryrefslogtreecommitdiffstats
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
parent4ac073640a528662a7c072a30e92e70ce00ded33 (diff)
parent9e82bf014195d6f0054982c463575cdce24292be (diff)
downloadop-kernel-dev-b2efb3f0a1db62aff5e824125785ec6731143b6d.zip
op-kernel-dev-b2efb3f0a1db62aff5e824125785ec6731143b6d.tar.gz
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 0acb2de..ecd4e0b 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)
OpenPOWER on IntegriCloud