drm/amdgpu: fix memleak of ring sched and fence driver
Subsystems (2)
PATCH v2 1/1 drm/amdgpu: fix memleak of ring sched and fence driver
commit 4220d2c7c41b ("drm/amdgpu: remove is_mes_queue flag") set ring->adev->ring[ring-idx] as NULL at the end of function amdgpu_ring_fini() which will cause function amdgpu_fence_driver_sw_fini() skip drm_sched_fini() and free fence_drv.fence then cause memory leak.
Remove set rings[ring->idx] as NULL to fix this issue
--- 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.50.1
Christian König
maintainerAlex already send exactly that patch yesterday.
Please review that one instead.
Thanks,
Christian.
Quoted 26 lines · Lin.Cao
commit
4220d2c7c41b("drm/amdgpu: removeis_mes_queueflag") set ring->adev->ring[ring-idx] as NULL at the end of functionamdgpu_ring_fini()which will cause functionamdgpu_fence_driver_sw_fini()skipdrm_sched_fini()and free fence_drv.fence then cause memory leak.Remove set rings[ring->idx] as NULL to fix this issue
Fixes 4220d2c7c41b ("drm/amdgpu: remove is_mes_queue flag")Signed-off-by Lin.Cao <[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 ; }/**