drm/nvc0: reject the notifier_alloc ioctl
authorBen Skeggs <bskeggs@redhat.com>
Wed, 24 Nov 2010 00:07:21 +0000 (10:07 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 21 Dec 2010 07:17:23 +0000 (17:17 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_notifier.c

index a050b7b69782494fb35cb13e15ca673529bdc607..fe29d604b820cf2f5c82d27738bdb1c77f840a94 100644 (file)
@@ -164,10 +164,15 @@ int
 nouveau_ioctl_notifier_alloc(struct drm_device *dev, void *data,
                             struct drm_file *file_priv)
 {
+       struct drm_nouveau_private *dev_priv = dev->dev_private;
        struct drm_nouveau_notifierobj_alloc *na = data;
        struct nouveau_channel *chan;
        int ret;
 
+       /* completely unnecessary for these chipsets... */
+       if (unlikely(dev_priv->card_type >= NV_C0))
+               return -EINVAL;
+
        chan = nouveau_channel_get(dev, file_priv, na->channel);
        if (IS_ERR(chan))
                return PTR_ERR(chan);