From: Yong Zhao <[email protected]>

[ Upstream commit 66f28b9a169855367d6e3ef71001969a8bffb19b ]

When the queue creation failed, some resources were not freed. Fix it.

Signed-off-by: Yong Zhao <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Reviewed-by: Felix Kuehling <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
 drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c 
b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
index 31fcd1b51f00f..4f7927b661ff4 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
@@ -328,6 +328,9 @@ int pqm_create_queue(struct process_queue_manager *pqm,
        return retval;
 
 err_create_queue:
+       uninit_queue(q);
+       if (kq)
+               kernel_queue_uninit(kq, false);
        kfree(pqn);
 err_allocate_pqn:
        /* check if queues list is empty unregister process from device */
-- 
2.20.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to