[PATCH] drm/amdgpu: fix memory leak in mes self test

Zhang, Hawking Hawking.Zhang at amd.com
Fri Apr 21 07:53:19 UTC 2023


[AMD Official Use Only - General]

Reviewed-by: Hawking Zhang <Hawking.Zhang at amd.com>

Regards,
Hawking
-----Original Message-----
From: Xiao, Jack <Jack.Xiao at amd.com>
Sent: Friday, April 21, 2023 15:06
To: amd-gfx at lists.freedesktop.org; Zhang, Hawking <Hawking.Zhang at amd.com>
Cc: Xiao, Jack <Jack.Xiao at amd.com>
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 <Jack.Xiao at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
index dc474b809604..4a35cee4cb83 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
@@ -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



More information about the amd-gfx mailing list