]> Git Repo - linux.git/commitdiff
drm/amdgpu: Fix leak when GPU memory allocation fails
authorMukul Joshi <[email protected]>
Thu, 18 Apr 2024 15:32:34 +0000 (11:32 -0400)
committerAlex Deucher <[email protected]>
Fri, 19 Apr 2024 03:54:49 +0000 (23:54 -0400)
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]>
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c

index df58a6a1a67ec51f1bb81ff1bd8364be8a46cc13..7c23ba19af33a181065b3a241cbdb9d4588bb203 100644 (file)
@@ -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);
This page took 0.059508 seconds and 4 git commands to generate.