summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorZhen Ni <nizhen@uniontech.com>2022-08-03 17:19:58 +0800
committerAlex Deucher <alexander.deucher@amd.com>2022-08-10 15:41:23 -0400
commit5afb76522a0af0513b6dc01f84128a73206b051b (patch)
tree5cd9b7801215927f53a4278ad954668b0129114c /drivers/gpu
parentdc0a096bcc1d659ae93f836099c6b0312d2ccaaf (diff)
downloadlinux-stable-5afb76522a0af0513b6dc01f84128a73206b051b.tar.gz
linux-stable-5afb76522a0af0513b6dc01f84128a73206b051b.tar.bz2
linux-stable-5afb76522a0af0513b6dc01f84128a73206b051b.zip
drm/amd/pm: Fix a potential gpu_metrics_table memory leak
Memory is allocated for gpu_metrics_table in smu_v13_0_4_init_smc_tables(), but not freed in smu_v13_0_4_fini_smc_tables(). This may cause memory leaks, fix it. Reviewed-by: Evan Quan <evan.quan@amd.com> Signed-off-by: Zhen Ni <nizhen@uniontech.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c
index 64665e8a86e4..97e1d55dcaad 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c
@@ -198,6 +198,9 @@ static int smu_v13_0_4_fini_smc_tables(struct smu_context *smu)
kfree(smu_table->watermarks_table);
smu_table->watermarks_table = NULL;
+ kfree(smu_table->gpu_metrics_table);
+ smu_table->gpu_metrics_table = NULL;
+
return 0;
}