summaryrefslogtreecommitdiff
path: root/shared-core/via_dma.c
diff options
context:
space:
mode:
Diffstat (limited to 'shared-core/via_dma.c')
-rw-r--r--shared-core/via_dma.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/shared-core/via_dma.c b/shared-core/via_dma.c
index ce471a25..cfeb53b8 100644
--- a/shared-core/via_dma.c
+++ b/shared-core/via_dma.c
@@ -191,13 +191,20 @@ int via_dma_init(DRM_IOCTL_ARGS)
switch (init.func) {
case VIA_INIT_DMA:
- retcode = via_initialize(dev, dev_priv, &init);
+ if (!capable(CAP_SYS_ADMIN))
+ retcode = DRM_ERR(EPERM);
+ else
+ retcode = via_initialize(dev, dev_priv, &init);
break;
case VIA_CLEANUP_DMA:
- retcode = via_dma_cleanup(dev);
+ if (!capable(CAP_SYS_ADMIN))
+ retcode = DRM_ERR(EPERM);
+ else
+ retcode = via_dma_cleanup(dev);
break;
case VIA_DMA_INITIALIZED:
- retcode = (dev_priv->ring.virtual_start != NULL) ? 0: DRM_ERR( EFAULT );
+ retcode = (dev_priv->ring.virtual_start != NULL) ?
+ 0: DRM_ERR( EFAULT );
break;
default:
retcode = DRM_ERR(EINVAL);