summaryrefslogtreecommitdiff
path: root/shared-core/nouveau_fifo.c
diff options
context:
space:
mode:
authorBen Skeggs <skeggsb@gmail.com>2007-07-11 12:38:48 +1000
committerBen Skeggs <skeggsb@gmail.com>2007-07-11 12:39:30 +1000
commit13e1377044d581d692af77656e3bc32c9eb183f7 (patch)
treef88fd9dff940f57937c9da2faaee4b60317fb980 /shared-core/nouveau_fifo.c
parent694e1c5c3f768436651ddf95e11ab5a89ccc8ffa (diff)
nouveau: Some checks on userspace object handles.
Diffstat (limited to 'shared-core/nouveau_fifo.c')
-rw-r--r--shared-core/nouveau_fifo.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/shared-core/nouveau_fifo.c b/shared-core/nouveau_fifo.c
index bc3a9948..fcdc14c8 100644
--- a/shared-core/nouveau_fifo.c
+++ b/shared-core/nouveau_fifo.c
@@ -474,6 +474,9 @@ static int nouveau_ioctl_fifo_alloc(DRM_IOCTL_ARGS)
DRM_COPY_FROM_USER_IOCTL(init, (drm_nouveau_fifo_alloc_t __user *) data,
sizeof(init));
+ if (init.fb_ctxdma_handle == ~0 || init.tt_ctxdma_handle == ~0)
+ return DRM_ERR(EINVAL);
+
res = nouveau_fifo_alloc(dev, &init.channel, filp,
init.fb_ctxdma_handle,
init.tt_ctxdma_handle);