Skip to contentSkip to conversation

powerpc/powernv: Use more common error handling code in imc_pmu_create()

PATCH New Markus Elfring 1 participant 1 message Jun 18

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/powernv: Use more common error handling code in imc_pmu_create()

From: Markus Elfring <[email protected]>
Date: Thu, 18 Jun 2026 21:04:51 +0200

Use an existing label once more so that a bit of exception handling can be better reused at the end of this function implementation.

This issue was detected by using the Coccinelle software.

---
 arch/powerpc/platforms/powernv/opal-imc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/platforms/powernv/opal-imc.c +2 -2
index b3fd5c648dea..522880d717f1 100644
@@ -168,8 +168,8 @@ static struct imc_pmu *imc_pmu_create(struct device_node *parent, int pmu_index,
 		kfree(pmu_ptr->pmu.name);
 		if (pmu_ptr->domain == IMC_DOMAIN_NEST)
 			kfree(pmu_ptr->mem_info);
-		kfree(pmu_ptr);
-		return NULL;
+
+		goto free_pmu;
 	}
 
 	return pmu_ptr;
Signature · 1 line
2.54.0