Skip to content

Commit 541d54e

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_5_init_smc_tables(), but not freed in smu_v13_0_5_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 5afb765 commit 541d54e

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_5_ppt.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ static int smu_v13_0_5_fini_smc_tables(struct smu_context *smu)
176176
kfree(smu_table->watermarks_table);
177177
smu_table->watermarks_table = NULL;
178178

179+
kfree(smu_table->gpu_metrics_table);
180+
smu_table->gpu_metrics_table = NULL;
181+
179182
return 0;
180183
}
181184

0 commit comments

Comments
 (0)