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.19-rc1~56^2~3^2~28 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d2f4460a3d9502513419f06cc376c7ade49d5753;p=thirdparty%2Flinux.git drm/amd/pm: fix a potential gpu_metrics_table memory leak 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 --- 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 87257b1b028f7..feff4f8c927cc 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; }