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 <mukul.joshi@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 7e38ccb commit e53a171

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

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)