Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 851a52eb authored by Mukul Joshi's avatar Mukul Joshi Committed by Greg Kroah-Hartman
Browse files

drm/amdgpu: Fix leak when GPU memory allocation fails



commit 25e9227c6afd200bed6774c866980b8e36d033af upstream.

Free the sync object if the memory allocation fails for any
reason.

Signed-off-by: default avatarMukul Joshi <mukul.joshi@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 21722c0b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1204,6 +1204,7 @@ int amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu(
err_bo_create:
	unreserve_mem_limit(adev, size, alloc_domain, !!sg);
err_reserve_limit:
	amdgpu_sync_free(&(*mem)->sync);
	mutex_destroy(&(*mem)->lock);
	kfree(*mem);
err: