Skip to content

Commit

Permalink
i915 compat ioctl(): just use drm_ioctl_kernel()
Browse files Browse the repository at this point in the history
compat_alloc_user_space() is a bad kludge; the sooner it goes, the
better...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed May 2, 2020
1 parent 502f78c commit fd7cd8d
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions drivers/gpu/drm/i915/i915_ioc32.c
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = {
Expand Down

0 comments on commit fd7cd8d

Please sign in to comment.