drm/amdgpu: fix memory leak in mes self test
authorJack Xiao <Jack.Xiao@amd.com>
Fri, 21 Apr 2023 06:20:38 +0000 (14:20 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 24 Apr 2023 22:16:02 +0000 (18:16 -0400)
The fences associated with mes queue have to be freed
up during amdgpu_ring_fini.

Signed-off-by: Jack Xiao <Jack.Xiao@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c

index f676c23..eaf0f82 100644 (file)
@@ -390,6 +390,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);