From 4bcb78433909ba7647972740b7709f3a0a60b1f7 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Mon, 4 Aug 2025 14:34:13 -0400 Subject: [PATCH] nouveau/winsys: Allow subchan_dealloc() on zeroed subchans This makes cleanup a little more robust. I'm not sure it's strictly needed as the kernel will probably just error in that case but it's probably safer to not call destroy on something that isn't registered or is already destroyed. Reviewed-by: Mel Henning Part-of: --- src/nouveau/winsys/nouveau_context.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/nouveau/winsys/nouveau_context.c b/src/nouveau/winsys/nouveau_context.c index d5f8ebbcfaa..d66848fc496 100644 --- a/src/nouveau/winsys/nouveau_context.c +++ b/src/nouveau/winsys/nouveau_context.c @@ -11,6 +11,9 @@ static void nouveau_ws_subchan_dealloc(int fd, struct nouveau_ws_object *obj) { + if (obj->cls == 0) + return; + struct { struct nvif_ioctl_v0 ioctl; struct nvif_ioctl_del del;