summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_drv.c
diff options
context:
space:
mode:
authorChris Wilson2016-06-24 15:00:23 +0200
committerChris Wilson2016-06-24 15:44:58 +0200
commitdda330099afc10160d1ae1f74838f8452169dbbd (patch)
tree7f18f0fb855d410cc86fb45db66347ca88660b60 /drivers/gpu/drm/i915/i915_drv.c
parentdrm/i915: Merge i915_dma.c into i915_drv.c (diff)
downloadkernel-qcow2-linux-dda330099afc10160d1ae1f74838f8452169dbbd.tar.gz
kernel-qcow2-linux-dda330099afc10160d1ae1f74838f8452169dbbd.tar.xz
kernel-qcow2-linux-dda330099afc10160d1ae1f74838f8452169dbbd.zip
drm/i915: Remove user controllable DRM_ERROR for i915_getparam()
The GETPARAM ioctl writes to a user supplied address. If that address is invalid, it is the user's error and not the driver's, so quietly report EFAULT and don't blame ourselves with a DRM_ERROR. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1466773227-7994-11-git-send-email-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/i915_drv.c')
-rw-r--r--drivers/gpu/drm/i915/i915_drv.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index e2375361a34d..afa3e99fd48a 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -752,10 +752,8 @@ static int i915_getparam(struct drm_device *dev, void *data,
return -EINVAL;
}
- if (copy_to_user(param->value, &value, sizeof(int))) {
- DRM_ERROR("copy_to_user failed\n");
+ if (put_user(value, param->value))
return -EFAULT;
- }
return 0;
}