powerpc/powernv: Use more common error handling code in imc_pmu_create()
Subsystems (2)
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.
Signed-off-by Markus Elfring <[email protected]>
--- arch/powerpc/platforms/powernv/opal-imc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/platforms/powernv/opal-imc.c +2 -2
@@ -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