Skip to content

Commit 5afb765

Browse files
nizhenthalexdeucher
authored andcommitted
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 <[email protected]> Signed-off-by: Zhen Ni <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent dc0a096 commit 5afb765

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,9 @@ static int smu_v13_0_4_fini_smc_tables(struct smu_context *smu)
198198
kfree(smu_table->watermarks_table);
199199
smu_table->watermarks_table = NULL;
200200

201+
kfree(smu_table->gpu_metrics_table);
202+
smu_table->gpu_metrics_table = NULL;
203+
201204
return 0;
202205
}
203206

0 commit comments

Comments
 (0)