diff options
author | Zhen Ni <nizhen@uniontech.com> | 2022-08-03 17:19:58 +0800 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2022-08-10 15:41:23 -0400 |
commit | 5afb76522a0af0513b6dc01f84128a73206b051b (patch) | |
tree | 5cd9b7801215927f53a4278ad954668b0129114c /drivers/gpu | |
parent | dc0a096bcc1d659ae93f836099c6b0312d2ccaaf (diff) | |
download | linux-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.c | 3 |
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; } |