aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_ioc32.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2020-02-19 11:20:34 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2020-05-01 20:35:26 -0400
commitfd7cd8da232d892f2b7dc4766f8a05a81043ee5e (patch)
treeb3fd06b7e99bda93d803a12f067ae9b54a6f5e8e /drivers/gpu/drm/i915/i915_ioc32.c
parenti915: switch copy_perf_config_registers_or_number() to unsafe_put_user() (diff)
downloadlinux-dev-fd7cd8da232d892f2b7dc4766f8a05a81043ee5e.tar.xz
linux-dev-fd7cd8da232d892f2b7dc4766f8a05a81043ee5e.zip
i915 compat ioctl(): just use drm_ioctl_kernel()
compat_alloc_user_space() is a bad kludge; the sooner it goes, the better... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_ioc32.c')
-rw-r--r--drivers/gpu/drm/i915/i915_ioc32.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/gpu/drm/i915/i915_ioc32.c b/drivers/gpu/drm/i915/i915_ioc32.c
index 8e45ca3d2ede..55b97c3a3dde 100644
--- a/drivers/gpu/drm/i915/i915_ioc32.c
+++ b/drivers/gpu/drm/i915/i915_ioc32.c
@@ -47,20 +47,16 @@ static int compat_i915_getparam(struct file *file, unsigned int cmd,
unsigned long arg)
{
struct drm_i915_getparam32 req32;
- drm_i915_getparam_t __user *request;
+ struct drm_i915_getparam req;
if (copy_from_user(&req32, (void __user *)arg, sizeof(req32)))
return -EFAULT;
- request = compat_alloc_user_space(sizeof(*request));
- if (!access_ok(request, sizeof(*request)) ||
- __put_user(req32.param, &request->param) ||
- __put_user((void __user *)(unsigned long)req32.value,
- &request->value))
- return -EFAULT;
+ req.param = req32.param;
+ req.value = compat_ptr(req32.value);
- return drm_ioctl(file, DRM_IOCTL_I915_GETPARAM,
- (unsigned long)request);
+ return drm_ioctl_kernel(file, i915_getparam_ioctl, &req,
+ DRM_RENDER_ALLOW);
}
static drm_ioctl_compat_t *i915_compat_ioctls[] = {