drm/nouveau: fix crash with noaccel=1
authorMarcin Slusarz <marcin.slusarz@gmail.com>
Sun, 11 Nov 2012 19:00:09 +0000 (20:00 +0100)
committerBen Skeggs <bskeggs@redhat.com>
Sun, 18 Nov 2012 22:52:20 +0000 (08:52 +1000)
Reported-by: Ortwin Glück <odi@odi.ch>
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_abi16.c

index cc79c79..cbf1fc6 100644 (file)
@@ -241,6 +241,10 @@ nouveau_abi16_ioctl_channel_alloc(ABI16_IOCTL_ARGS)
 
        if (unlikely(!abi16))
                return -ENOMEM;
+
+       if (!drm->channel)
+               return nouveau_abi16_put(abi16, -ENODEV);
+
        client = nv_client(abi16->client);
 
        if (init->fb_ctxdma_handle == ~0 || init->tt_ctxdma_handle == ~0)