drm/amdgpu: fix memory leak in mes self test
Subsystems (2)
PATCH 1/1 drm/amdgpu: fix memory leak in mes self test
The fences associated with mes queue have to be freed up during amdgpu_ring_fini.
Signed-off-by Jack Xiao <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +2 -0
@@ -361,6 +361,8 @@ void amdgpu_ring_fini(struct amdgpu_ring *ring)amdgpu_bo_free_kernel (&ring->ring_obj, &ring->gpu_addr, (void **)&ring->ring); + }else { +kfree (ring->fence_drv.fences); }dma_fence_put (ring->vmid_wait);
Signature · 1 line
2.37.3
[AMD Official Use Only - General]
Reviewed-by Hawking Zhang <[email protected]>
Regards,
Hawking
-----Original Message-----
From: Xiao, Jack <[email protected]>
Sent: Friday, April 21, 2023 15:06
To: [email protected]; Zhang, Hawking <[email protected]>
Cc: Xiao, Jack <[email protected]>
Subject: [PATCH] drm/amdgpu: fix memory leak in mes self test
The fences associated with mes queue have to be freed up during amdgpu_ring_fini.
Signed-off-by Jack Xiao <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +2 -0
@@ -361,6 +361,8 @@ void amdgpu_ring_fini(struct amdgpu_ring *ring)amdgpu_bo_free_kernel (&ring->ring_obj, &ring->gpu_addr, (void **)&ring->ring); + }else { +kfree (ring->fence_drv.fences); }dma_fence_put (ring->vmid_wait);
--
2.37.3
Am 21.04.23 um 09:06 schrieb Jack Xiao:
Quoted 4 lines
The fences associated with mes queue have to be freed up during
amdgpu_ring_fini.Signed-off-by Jack Xiao <[email protected]>
Well big NAK to this! The fences are supposed to be freed by the fence handling code.
Christian.
Quoted 17 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 2 ++ 1 file changed, 2 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +2
-0@@ -361,6 +361,8 @@ void amdgpu_ring_fini(struct amdgpu_ring *ring)amdgpu_bo_free_kernel (&ring->ring_obj, &ring->gpu_addr, (void **)&ring->ring); + }else { +kfree (ring->fence_drv.fences); }dma_fence_put (ring->vmid_wait);