summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMukul Joshi <mukul.joshi@amd.com>2024-04-18 11:32:34 -0400
committerAlex Deucher <alexander.deucher@amd.com>2024-04-18 23:54:49 -0400
commite53a1713de314204f66cc186a74115ea62407876 (patch)
tree86b638994c6b603071ca3b95031d06dc304a68fb
parent7e38ccb5276fe28f60088181ff4d279a8277b708 (diff)
drm/amdgpu: Fix leak when GPU memory allocation fails
Free the sync object if the memory allocation fails for any reason. Signed-off-by: Mukul Joshi <mukul.joshi@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
index df58a6a1a67e..7c23ba19af33 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
@@ -1854,6 +1854,7 @@ err_node_allow:
err_bo_create:
amdgpu_amdkfd_unreserve_mem_limit(adev, aligned_size, flags, xcp_id);
err_reserve_limit:
+ amdgpu_sync_free(&(*mem)->sync);
mutex_destroy(&(*mem)->lock);
if (gobj)
drm_gem_object_put(gobj);