Skip to content

Commit fd7cd8d

Browse files
author
Al Viro
committed
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 <[email protected]>
1 parent 502f78c commit fd7cd8d

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

drivers/gpu/drm/i915/i915_ioc32.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,16 @@ static int compat_i915_getparam(struct file *file, unsigned int cmd,
4747
unsigned long arg)
4848
{
4949
struct drm_i915_getparam32 req32;
50-
drm_i915_getparam_t __user *request;
50+
struct drm_i915_getparam req;
5151

5252
if (copy_from_user(&req32, (void __user *)arg, sizeof(req32)))
5353
return -EFAULT;
5454

55-
request = compat_alloc_user_space(sizeof(*request));
56-
if (!access_ok(request, sizeof(*request)) ||
57-
__put_user(req32.param, &request->param) ||
58-
__put_user((void __user *)(unsigned long)req32.value,
59-
&request->value))
60-
return -EFAULT;
55+
req.param = req32.param;
56+
req.value = compat_ptr(req32.value);
6157

62-
return drm_ioctl(file, DRM_IOCTL_I915_GETPARAM,
63-
(unsigned long)request);
58+
return drm_ioctl_kernel(file, i915_getparam_ioctl, &req,
59+
DRM_RENDER_ALLOW);
6460
}
6561

6662
static drm_ioctl_compat_t *i915_compat_ioctls[] = {

0 commit comments

Comments
 (0)