drm/amdkfd: fix a potential double free in pqm_create_queue
authorjsg <jsg@openbsd.org>
Fri, 7 Apr 2023 03:52:40 +0000 (03:52 +0000)
committerjsg <jsg@openbsd.org>
Fri, 7 Apr 2023 03:52:40 +0000 (03:52 +0000)
From Chia-I Wu
b861f0e62ae148eb5f0a48c4d6fcd5dc03b4e252 in linux-6.1.y/6.1.23
b2ca5c5d416b4e72d1e9d0293fc720e2d525fd42 in mainline linux

sys/dev/pci/drm/amd/amdkfd/kfd_process_queue_manager.c

index 5137476..4236539 100644 (file)
@@ -218,8 +218,8 @@ static int init_user_queue(struct process_queue_manager *pqm,
        return 0;
 
 cleanup:
-       if (dev->shared_resources.enable_mes)
-               uninit_queue(*q);
+       uninit_queue(*q);
+       *q = NULL;
        return retval;
 }