unref bo after amdgpu_bo_unreserve() failure as it has
called amdgpu_bo_ref() already

Signed-off-by: David (Ming Qiang) Wu <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
index 2aeeaa954882..99ae1d19b751 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
@@ -386,6 +386,7 @@ static int amdgpu_userq_fence_read_wptr(struct 
amdgpu_usermode_queue *queue,
        amdgpu_bo_unreserve(queue->vm->root.bo);
        r = amdgpu_bo_reserve(bo, true);
        if (r) {
+               amdgpu_bo_unref(&bo);
                DRM_ERROR("Failed to reserve userqueue wptr bo");
                return r;
        }
-- 
2.43.0

Reply via email to