diff options
author | Dave Airlie <airlied@redhat.com> | 2014-09-16 05:28:52 +0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2014-09-16 05:38:04 +0400 |
commit | b2efb3f0a1db62aff5e824125785ec6731143b6d (patch) | |
tree | 67510cec69e18e55d82bed803428b2a5027d92bb /drivers/gpu/drm/drm_crtc.c | |
parent | 4ac073640a528662a7c072a30e92e70ce00ded33 (diff) | |
parent | 9e82bf014195d6f0054982c463575cdce24292be (diff) | |
download | linux-b2efb3f0a1db62aff5e824125785ec6731143b6d.tar.xz |
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.c | 3 |
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) |