From: Gong Yuanjun Date: Tue, 17 May 2022 09:57:46 +0000 (+0800) Subject: drm/amd/pm: fix a potential gpu_metrics_table memory leak X-Git-Tag: v5.17.15~69 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7a3ab1f44def86f0de9439fd5308a288b621a40e;p=thirdparty%2Fkernel%2Fstable.git drm/amd/pm: fix a potential gpu_metrics_table memory leak [ Upstream commit d2f4460a3d9502513419f06cc376c7ade49d5753 ] gpu_metrics_table is allocated in yellow_carp_init_smc_tables() but not freed in yellow_carp_fini_smc_tables(). Signed-off-by: Gong Yuanjun Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c index d0715927b07f6..13461e28aeedb 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c @@ -190,6 +190,9 @@ static int yellow_carp_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; }