Skip to content

Commit e53a171

Browse files
mukjoshialexdeucher
authored andcommitted
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 <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 7e38ccb commit e53a171

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1854,6 +1854,7 @@ int amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu(
18541854
err_bo_create:
18551855
amdgpu_amdkfd_unreserve_mem_limit(adev, aligned_size, flags, xcp_id);
18561856
err_reserve_limit:
1857+
amdgpu_sync_free(&(*mem)->sync);
18571858
mutex_destroy(&(*mem)->lock);
18581859
if (gobj)
18591860
drm_gem_object_put(gobj);

0 commit comments

Comments
 (0)