summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
diff options
context:
space:
mode:
authorMonk Liu2017-11-14 09:55:14 +0100
committerAlex Deucher2017-11-16 19:36:24 +0100
commit9862def99d6fd007e73d9b7d8474ae18c1b4ce48 (patch)
treeae5f10a29235a1693089c75d7e8ff4f207dc5b59 /drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
parentdrm/amdgpu:fix memleak in takedown (diff)
downloadkernel-qcow2-linux-9862def99d6fd007e73d9b7d8474ae18c1b4ce48.tar.gz
kernel-qcow2-linux-9862def99d6fd007e73d9b7d8474ae18c1b4ce48.tar.xz
kernel-qcow2-linux-9862def99d6fd007e73d9b7d8474ae18c1b4ce48.zip
drm/amdgpu:fix memleak
those RLC used buffers are not cleared in GFX's sw_fini Signed-off-by: Monk Liu <Monk.Liu@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
index bc32bbde1165..da43813d67a4 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
@@ -1468,6 +1468,14 @@ static int gfx_v9_0_sw_fini(void *handle)
gfx_v9_0_mec_fini(adev);
gfx_v9_0_ngg_fini(adev);
+ amdgpu_bo_free_kernel(&adev->gfx.rlc.clear_state_obj,
+ &adev->gfx.rlc.clear_state_gpu_addr,
+ (void **)&adev->gfx.rlc.cs_ptr);
+ if (adev->asic_type == CHIP_RAVEN) {
+ amdgpu_bo_free_kernel(&adev->gfx.rlc.cp_table_obj,
+ &adev->gfx.rlc.cp_table_gpu_addr,
+ (void **)&adev->gfx.rlc.cp_table_ptr);
+ }
gfx_v9_0_free_microcode(adev);
return 0;