From 8f1e481aebc0b5350653361555411f99565ce258 Mon Sep 17 00:00:00 2001 From: jsg Date: Mon, 11 Dec 2023 05:21:50 +0000 Subject: [PATCH] drm/amd/pm: fix a memleak in aldebaran_tables_init From Dinghao Liu 0e0a95166882e594af4ab4f8c6f7894c2c32f6a9 in linux-6.1.y/6.1.66 7a88f23e768491bae653b444a96091d2aaeb0818 in mainline linux --- sys/dev/pci/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c b/sys/dev/pci/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c index 4ee364060c1..175247efcb4 100644 --- a/sys/dev/pci/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c +++ b/sys/dev/pci/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c @@ -258,8 +258,11 @@ static int aldebaran_tables_init(struct smu_context *smu) } smu_table->ecc_table = kzalloc(tables[SMU_TABLE_ECCINFO].size, GFP_KERNEL); - if (!smu_table->ecc_table) + if (!smu_table->ecc_table) { + kfree(smu_table->metrics_table); + kfree(smu_table->gpu_metrics_table); return -ENOMEM; + } return 0; } -- 2.20.1