From: Mukul Joshi Date: Thu, 18 Apr 2024 15:32:34 +0000 (-0400) Subject: drm/amdgpu: Fix leak when GPU memory allocation fails X-Git-Tag: v6.6.30~44 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d7d7284c2a7c67ea5f07eb28d8c2ea0f3ee4b86b;p=thirdparty%2Fkernel%2Fstable.git 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: Mukul Joshi Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c index e036011137aa2..15c5a2533ba60 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c @@ -1785,6 +1785,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);