drm/amdgpu/userq: Call unreserve on error in amdgpu_userq_fence_read_wptr()
authorDan Carpenter <dan.carpenter@linaro.org>
Wed, 30 Apr 2025 08:01:24 +0000 (11:01 +0300)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 30 Apr 2025 22:17:42 +0000 (18:17 -0400)
This error path should call amdgpu_bo_unreserve() before returning.

Fixes: d8675102ba32 ("drm/amdgpu: add vm root BO lock before accessing the vm")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c

index 3288c2ff692e74f590dd6e8c18c05022a846fac3..34200cd04f274ee922def246369381221dec678b 100644 (file)
@@ -370,6 +370,7 @@ static int amdgpu_userq_fence_read_wptr(struct amdgpu_usermode_queue *queue,
 
        mapping = amdgpu_vm_bo_lookup_mapping(queue->vm, addr >> PAGE_SHIFT);
        if (!mapping) {
+               amdgpu_bo_unreserve(queue->vm->root.bo);
                DRM_ERROR("Failed to lookup amdgpu_bo_va_mapping\n");
                return -EINVAL;
        }