drm/amd/powerplay: update hw fini function to relase some memory
authorLikun Gao <Likun.Gao@amd.com>
Mon, 17 Dec 2018 12:59:42 +0000 (20:59 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 19 Mar 2019 20:03:56 +0000 (15:03 -0500)
Release memory of table_context->driver_pptable and
table_context->ppt_information when smu hw fini.

Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Kevin Wang <Kevin1.Wang@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c

index c853166179515062c2c9100d5dfb52676a8fd987..e4da464655f8b2ecf985079c84115816f2868f92 100644 (file)
@@ -434,11 +434,16 @@ static int smu_hw_fini(void *handle)
 {
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
        struct smu_context *smu = &adev->smu;
+       struct smu_table_context *table_context = &smu->smu_table;
        int ret = 0;
 
        if (adev->asic_type < CHIP_VEGA20)
                return -EINVAL;
 
+       if (!table_context->driver_pptable)
+               return -EINVAL;
+       kfree(table_context->driver_pptable);
+
        ret = smu_fini_fb_allocations(smu);
        if (ret)
                return ret;