diff options
Diffstat (limited to 'drivers/gpu/drm/drm_drv.c')
-rw-r--r-- | drivers/gpu/drm/drm_drv.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index c4ada8b6295b..019b7c578236 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c | |||
@@ -456,7 +456,8 @@ int drm_ioctl(struct inode *inode, struct file *filp, | |||
456 | retcode = -EINVAL; | 456 | retcode = -EINVAL; |
457 | } else if (((ioctl->flags & DRM_ROOT_ONLY) && !capable(CAP_SYS_ADMIN)) || | 457 | } else if (((ioctl->flags & DRM_ROOT_ONLY) && !capable(CAP_SYS_ADMIN)) || |
458 | ((ioctl->flags & DRM_AUTH) && !file_priv->authenticated) || | 458 | ((ioctl->flags & DRM_AUTH) && !file_priv->authenticated) || |
459 | ((ioctl->flags & DRM_MASTER) && !file_priv->is_master)) { | 459 | ((ioctl->flags & DRM_MASTER) && !file_priv->is_master) || |
460 | (!(ioctl->flags & DRM_CONTROL_ALLOW) && (file_priv->minor->type == DRM_MINOR_CONTROL))) { | ||
460 | retcode = -EACCES; | 461 | retcode = -EACCES; |
461 | } else { | 462 | } else { |
462 | if (cmd & (IOC_IN | IOC_OUT)) { | 463 | if (cmd & (IOC_IN | IOC_OUT)) { |
@@ -480,7 +481,7 @@ int drm_ioctl(struct inode *inode, struct file *filp, | |||
480 | } | 481 | } |
481 | retcode = func(dev, kdata, file_priv); | 482 | retcode = func(dev, kdata, file_priv); |
482 | 483 | ||
483 | if ((retcode == 0) && (cmd & IOC_OUT)) { | 484 | if (cmd & IOC_OUT) { |
484 | if (copy_to_user((void __user *)arg, kdata, | 485 | if (copy_to_user((void __user *)arg, kdata, |
485 | _IOC_SIZE(cmd)) != 0) | 486 | _IOC_SIZE(cmd)) != 0) |
486 | retcode = -EFAULT; | 487 | retcode = -EFAULT; |