drm/amdkfd: Fix an inappropriate error handling in allloc memory of gpu
authorLang Yu <lang.yu@amd.com>
Mon, 11 Oct 2021 05:57:25 +0000 (13:57 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 19 Oct 2021 21:13:48 +0000 (17:13 -0400)
We should unreference a gem object instead of an amdgpu bo here.

Fixes: fd9a9f8801de ("drm/amdgpu: Use GEM obj reference for KFD BOs")

Signed-off-by: Lang Yu <lang.yu@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c

index 054c1a2..cdf46bd 100644 (file)
@@ -1503,7 +1503,7 @@ allocate_init_user_pages_failed:
        remove_kgd_mem_from_kfd_bo_list(*mem, avm->process_info);
        drm_vma_node_revoke(&gobj->vma_node, drm_priv);
 err_node_allow:
-       amdgpu_bo_unref(&bo);
+       drm_gem_object_put(gobj);
        /* Don't unreserve system mem limit twice */
        goto err_reserve_limit;
 err_bo_create: