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
[ Upstream commit aa46495 ]

Memory is allocated for gpu_metrics_table in renoir_init_smc_tables(),
but not freed in int smu_v12_0_fini_smc_tables(). Free it!

Fixes: 95868b8 ("drm/amd/powerplay: add Renoir support for gpu metrics export")

Signed-off-by: Lang Yu <lang.yu@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Lang Yu authored and gregkh committed Dec 22, 2021
1 parent 74dc97d commit 222cebd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/gpu/drm/amd/pm/swsmu/smu12/smu_v12_0.c
Expand Up @@ -187,6 +187,9 @@ int smu_v12_0_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 222cebd

Please sign in to comment.