Commit fd7cd8da authored by Al Viro's avatar Al Viro

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: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 502f78c8
...@@ -47,20 +47,16 @@ static int compat_i915_getparam(struct file *file, unsigned int cmd, ...@@ -47,20 +47,16 @@ static int compat_i915_getparam(struct file *file, unsigned int cmd,
unsigned long arg) unsigned long arg)
{ {
struct drm_i915_getparam32 req32; 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))) if (copy_from_user(&req32, (void __user *)arg, sizeof(req32)))
return -EFAULT; return -EFAULT;
request = compat_alloc_user_space(sizeof(*request)); req.param = req32.param;
if (!access_ok(request, sizeof(*request)) || req.value = compat_ptr(req32.value);
__put_user(req32.param, &request->param) ||
__put_user((void __user *)(unsigned long)req32.value,
&request->value))
return -EFAULT;
return drm_ioctl(file, DRM_IOCTL_I915_GETPARAM, return drm_ioctl_kernel(file, i915_getparam_ioctl, &req,
(unsigned long)request); DRM_RENDER_ALLOW);
} }
static drm_ioctl_compat_t *i915_compat_ioctls[] = { static drm_ioctl_compat_t *i915_compat_ioctls[] = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment