From: Likun Gao Date: Mon, 17 Dec 2018 12:59:42 +0000 (+0800) Subject: drm/amd/powerplay: update hw fini function to relase some memory X-Git-Tag: v5.2-rc1~48^2~36^2~313 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=afba8282292940378632c61e1686f230fa5be655;p=uclinux-h8%2Flinux.git drm/amd/powerplay: update hw fini function to relase some memory Release memory of table_context->driver_pptable and table_context->ppt_information when smu hw fini. Signed-off-by: Likun Gao Reviewed-by: Huang Rui Reviewed-by: Kevin Wang Acked-by: Alex Deucher Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c index c85316617951..e4da464655f8 100644 --- a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +++ b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c @@ -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;