drm/amdgpu: fix a memory leak in fence cleanup when unloading
Subsystems (2)
Alex Deucher
maintainerPATCH 1/1 drm/amdgpu: fix a memory leak in fence cleanup when unloading
Commit b61badd20b44 ("drm/amdgpu: fix usage slab after free") reordered when amdgpu_fence_driver_sw_fini() was called after that patch, amdgpu_fence_driver_sw_fini() effectively became a no-op as the sched entities we never freed because the ring pointers were already set to NULL. Remove the NULL setting.
Reported-by Lin.Cao <[email protected]>
Cc Vitaly Prosyak <[email protected]>
Cc Christian König <[email protected]>
Fixes b61badd20b44 ("drm/amdgpu: fix usage slab after free")
Signed-off-by Alex Deucher <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 2 -- 1 file changed, 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +0 -2
@@ -421,8 +421,6 @@ void amdgpu_ring_fini(struct amdgpu_ring *ring)dma_fence_put (ring->vmid_wait); ring->vmid_wait =NULL ; ring->me =0 ; - - ring->adev->rings[ring->idx] =NULL ; }/**
Signature · 1 line
2.51.0
Quoted 7 lines · Alex Deucher
Commit
b61badd20b44("drm/amdgpu: fix usage slab after free") reordered whenamdgpu_fence_driver_sw_fini()was called after that patch,amdgpu_fence_driver_sw_fini()effectively became a no-op as the sched entities we never freed because the ring pointers were already set to NULL. Remove the NULL setting.
Quoted 5 lines
Reported-by Lin.Cao <[email protected]>Cc Vitaly Prosyak <[email protected]>Cc Christian König <[email protected]>Fixes b61badd20b44 ("drm/amdgpu: fix usage slab after free")Signed-off-by Alex Deucher <[email protected]>
Reviewed-by Christian König <[email protected]>
Quoted 17 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 2 -- 1 file changed, 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +0
-2@@ -421,8 +421,6 @@ void amdgpu_ring_fini(struct amdgpu_ring *ring)dma_fence_put (ring->vmid_wait); ring->vmid_wait =NULL ; ring->me =0 ; - - ring->adev->rings[ring->idx] =NULL ; }/**