From: Markus Elfring <Markus.Elfring@web.de>
To: linuxppc-dev@lists.ozlabs.org,
Anju T Sudhakar <anju@linux.vnet.ibm.com>,
Christophe Leroy <chleroy@kernel.org>,
Kees Cook <kees@kernel.org>,
Madhavan Srinivasan <maddy@linux.vnet.ibm.com>,
Michael Ellerman <mpe@ellerman.id.au>,
Nicholas Piggin <npiggin@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH] powerpc/powernv: Use more common error handling code in imc_pmu_create()
Date: Thu, 18 Jun 2026 21:17:13 +0200 [thread overview]
Message-ID: <8dd3e02a-9d4b-4633-a703-890d5d108318@web.de> (raw)
From: Markus Elfring <elfring@users.sourceforge.net>
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 <elfring@users.sourceforge.net>
---
arch/powerpc/platforms/powernv/opal-imc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/platforms/powernv/opal-imc.c b/arch/powerpc/platforms/powernv/opal-imc.c
index b3fd5c648dea..522880d717f1 100644
--- a/arch/powerpc/platforms/powernv/opal-imc.c
+++ b/arch/powerpc/platforms/powernv/opal-imc.c
@@ -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;
--
2.54.0
reply other threads:[~2026-06-18 19:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8dd3e02a-9d4b-4633-a703-890d5d108318@web.de \
--to=markus.elfring@web.de \
--cc=anju@linux.vnet.ibm.com \
--cc=chleroy@kernel.org \
--cc=kees@kernel.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.vnet.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox