From: Markus Elfring <Markus.Elfring@web.de>
To: linux-riscv@lists.infradead.org, kernel-janitors@vger.kernel.org,
Palmer Dabbelt <palmer@dabbelt.com>,
Paul Walmsley <paul.walmsley@sifive.com>,
Thomas Gleixner <tglx@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>, cocci@inria.fr
Subject: [PATCH] irqchip/sifive-plic: One function call less in __plic_init() after error detection
Date: Tue, 26 Dec 2023 21:42:22 +0100 [thread overview]
Message-ID: <71aebecb-ab59-4835-9320-10e849c04a5c@web.de> (raw)
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 26 Dec 2023 21:34:47 +0100
The kfree() function was called in one case by the
__plic_init() function during error handling
even if the passed data structure member contained a null pointer.
This issue was detected by using the Coccinelle software.
Thus use an other label.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/irqchip/irq-sifive-plic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/irqchip/irq-sifive-plic.c b/drivers/irqchip/irq-sifive-plic.c
index 5b7bc4fd9517..e9e3ee2d6440 100644
--- a/drivers/irqchip/irq-sifive-plic.c
+++ b/drivers/irqchip/irq-sifive-plic.c
@@ -437,7 +437,7 @@ static int __init __plic_init(struct device_node *node,
priv->prio_save = bitmap_alloc(nr_irqs, GFP_KERNEL);
if (!priv->prio_save)
- goto out_free_priority_reg;
+ goto out_iounmap;
nr_contexts = of_irq_count(node);
if (WARN_ON(!nr_contexts))
--
2.43.0
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
reply other threads:[~2023-12-26 20:43 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=71aebecb-ab59-4835-9320-10e849c04a5c@web.de \
--to=markus.elfring@web.de \
--cc=cocci@inria.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=tglx@linutronix.de \
/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;
as well as URLs for NNTP newsgroup(s).