During queue creation failure, when we clean up mqd via
mqd_destroy we arent doing the wptr_obj cleanup and hence
adding that clean up.

Signed-off-by: Sunil Khatri <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
index c07aad2c6a53..68efed47f412 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
@@ -851,6 +851,10 @@ amdgpu_userq_create(struct drm_file *filp, union 
drm_amdgpu_userq *args)
 clean_mqd:
        mutex_unlock(&uq_mgr->userq_mutex);
        uq_funcs->mqd_destroy(queue);
+       amdgpu_bo_reserve(queue->wptr_obj.obj, true);
+       amdgpu_bo_unpin(queue->wptr_obj.obj);
+       amdgpu_bo_unreserve(queue->wptr_obj.obj);
+       amdgpu_bo_unref(&queue->wptr_obj.obj);
 clean_fence_driver:
        amdgpu_userq_fence_driver_free(queue);
 clean_doorbell:
-- 
2.34.1

Reply via email to