From: Marcin Slusarz Date: Sun, 11 Nov 2012 19:00:09 +0000 (+0100) Subject: drm/nouveau: fix crash with noaccel=1 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=bf7e438bcaff4b732f86bb2eb48fc4fee04dc31b;p=linux-beck.git drm/nouveau: fix crash with noaccel=1 Reported-by: Ortwin Glück Signed-off-by: Marcin Slusarz Signed-off-by: Ben Skeggs --- diff --git a/drivers/gpu/drm/nouveau/nouveau_abi16.c b/drivers/gpu/drm/nouveau/nouveau_abi16.c index cc79c796afee..cbf1fc60a386 100644 --- a/drivers/gpu/drm/nouveau/nouveau_abi16.c +++ b/drivers/gpu/drm/nouveau/nouveau_abi16.c @@ -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)