Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdgpu: free hw_vm_fence when fail in amdgpu_job_alloc

If drm_sched_job_init fails, hw_vm_fence is not freed currently,
then cause memory leak.

Fixes: db36632ea51e ("drm/amdgpu: clean up and unify hw fence handling")
Link: https://lore.kernel.org/amd-gfx/a5a828cb-0e4a-41f0-94c3-df31e5ddad52@amd.com/T/#t
Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
Reviewed-by: Amos Kong <kongjianjun@gmail.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>

authored by

Jiqian Chen and committed by
Alex Deucher
5d42ee45 fc3336be

+5 -2
+5 -2
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
··· 218 218 if (!entity) 219 219 return 0; 220 220 221 - return drm_sched_job_init(&(*job)->base, entity, 1, owner, 222 - drm_client_id); 221 + r = drm_sched_job_init(&(*job)->base, entity, 1, owner, drm_client_id); 222 + if (!r) 223 + return 0; 224 + 225 + kfree((*job)->hw_vm_fence); 223 226 224 227 err_fence: 225 228 kfree((*job)->hw_fence);