summaryrefslogtreecommitdiff
path: root/shared
diff options
context:
space:
mode:
Diffstat (limited to 'shared')
-rw-r--r--shared/via.h4
-rw-r--r--shared/via_dma.c13
2 files changed, 12 insertions, 5 deletions
diff --git a/shared/via.h b/shared/via.h
index 960f5e2d..2811d786 100644
--- a/shared/via.h
+++ b/shared/via.h
@@ -30,11 +30,11 @@
#define DRIVER_NAME "via"
#define DRIVER_DESC "VIA Unichrome"
-#define DRIVER_DATE "20041220"
+#define DRIVER_DATE "20041221"
#define DRIVER_MAJOR 2
#define DRIVER_MINOR 3
-#define DRIVER_PATCHLEVEL 2
+#define DRIVER_PATCHLEVEL 3
#define DRIVER_IOCTLS \
[DRM_IOCTL_NR(DRM_IOCTL_VIA_ALLOCMEM)] = { via_mem_alloc, 1, 0 }, \
diff --git a/shared/via_dma.c b/shared/via_dma.c
index a5c4b0a3..000d4b0c 100644
--- a/shared/via_dma.c
+++ b/shared/via_dma.c
@@ -192,13 +192,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);