Skip to contentSkip to conversation

drm/nouveau: fix crash with noaccel=1

PATCH In review Marcin Slusarz 2 participants 2 messages Nov 11, 2012 – Nov 12, 2012 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/nouveau: fix crash with noaccel=1

---
 drivers/gpu/drm/nouveau/nouveau_abi16.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/nouveau/nouveau_abi16.c +4 -0
index cc79c79..cbf1fc6 100644
@@ -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)
Signature · 6 lines
1.7.12

_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau
#2 lore raw
In reply to a message not in the archive

I am confirming that it fixes the problem.

Thanks!

Ortwin

Quoted 13 lines · Marcin Slusarz
---
  drivers/gpu/drm/nouveau/nouveau_abi16.c | 4 ++++
  1 file changed, 4 insertions(+)
drivers/gpu/drm/nouveau/nouveau_abi16.c +0 -0
index cc79c79..cbf1fc6 100644

drivers/gpu/drm/nouveau/nouveau_abi16.c nouveau_abi16_ioctl_channel_alloc(ABI16_IOCTL_ARGS) · line 250

Quoted 10 lines
drivers/gpu/drm/nouveau/nouveau_abi16.c +4 -0
@@ -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)

_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau