Skip to content

Commit

Permalink
Merge tag 'drm-misc-fixes-2018-05-16' of git://anongit.freedesktop.or…
Browse files Browse the repository at this point in the history
…g/drm/drm-misc into drm-fixes

- core: Fix regression in dev node offsets (Haneen)
- vc4: Fix memory leak on driver close (Eric)
- dumb-buffers: Prevent overflow in DIV_ROUND_UP() (Dan)

Cc: Haneen Mohammed <hamohammed.sa@gmail.com>
Cc: Eric Anholt <eric@anholt.net>
Cc: Dan Carpenter <dan.carpenter@oracle.com>

* tag 'drm-misc-fixes-2018-05-16' of git://anongit.freedesktop.org/drm/drm-misc:
  drm/dumb-buffers: Integer overflow in drm_mode_create_ioctl()
  drm/vc4: Fix leak of the file_priv that stored the perfmon.
  drm: Match sysfs name in link removal to link creation
  • Loading branch information
Dave Airlie committed May 17, 2018
2 parents 76ef6b2 + 2b62072 commit 3d3aa96
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/drm_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ static void remove_compat_control_link(struct drm_device *dev)
if (!minor)
return;

name = kasprintf(GFP_KERNEL, "controlD%d", minor->index);
name = kasprintf(GFP_KERNEL, "controlD%d", minor->index + 64);
if (!name)
return;

Expand Down
7 changes: 4 additions & 3 deletions drivers/gpu/drm/drm_dumb_buffers.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,13 @@ int drm_mode_create_dumb_ioctl(struct drm_device *dev,
return -EINVAL;

/* overflow checks for 32bit size calculations */
/* NOTE: DIV_ROUND_UP() can overflow */
if (args->bpp > U32_MAX - 8)
return -EINVAL;
cpp = DIV_ROUND_UP(args->bpp, 8);
if (!cpp || cpp > 0xffffffffU / args->width)
if (cpp > U32_MAX / args->width)
return -EINVAL;
stride = cpp * args->width;
if (args->height > 0xffffffffU / stride)
if (args->height > U32_MAX / stride)
return -EINVAL;

/* test for wrap-around */
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/vc4/vc4_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ static void vc4_close(struct drm_device *dev, struct drm_file *file)
struct vc4_file *vc4file = file->driver_priv;

vc4_perfmon_close_file(vc4file);
kfree(vc4file);
}

static const struct vm_operations_struct vc4_vm_ops = {
Expand Down

0 comments on commit 3d3aa96

Please sign in to comment.