Skip to content

Commit

Permalink
drm/amd/pm: Fix a potential gpu_metrics_table memory leak
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
nizhenth authored and alexdeucher committed Aug 10, 2022
1 parent dc0a096 commit 5afb765
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 5afb765

Please sign in to comment.