]> Gentwo Git Trees - linux/.git/commitdiff
drm/amdgpu: free job fences on failure in amdgpu_job_alloc_with_ib
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Mon, 24 Nov 2025 14:42:50 +0000 (15:42 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 26 Nov 2025 16:27:24 +0000 (11:27 -0500)
Otherwise we're leaking memory.

Fixes: db36632ea51e ("drm/amdgpu: clean up and unify hw fence handling")
Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c

index 0707d2c2326f486e392cd6b9977d2f8c62bf40f1..0a0dcbf0798d3fe0cfa66f0b21e4dad729e823a0 100644 (file)
@@ -246,6 +246,8 @@ int amdgpu_job_alloc_with_ib(struct amdgpu_device *adev,
        if (r) {
                if (entity)
                        drm_sched_job_cleanup(&(*job)->base);
+               kfree((*job)->hw_vm_fence);
+               kfree((*job)->hw_fence);
                kfree(*job);
                *job = NULL;
        }