mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "irqchip-bot for Wei Yongjun" <tip-bot2@linutronix.de>
To: linux-kernel@vger.kernel.org
Cc: Wei Yongjun <weiyongjun1@huawei.com>,
	j.neuschaefer@gmx.net, Marc Zyngier <maz@kernel.org>,
	tglx@linutronix.de
Subject: [irqchip: irq/irqchip-next] irqchip/wpcm450: Fix memory leak in wpcm450_aic_of_init()
Date: Sat, 26 Nov 2022 13:34:29 -0000	[thread overview]
Message-ID: <166946966925.4906.3717360312262701265.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20221115092532.1704032-1-weiyongjun@huaweicloud.com>

The following commit has been merged into the irq/irqchip-next branch of irqchip:

Commit-ID:     4208d4faf36573a507b5e5de17abe342e9276759
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/4208d4faf36573a507b5e5de17abe342e9276759
Author:        Wei Yongjun <weiyongjun1@huawei.com>
AuthorDate:    Tue, 15 Nov 2022 09:25:32 
Committer:     Marc Zyngier <maz@kernel.org>
CommitterDate: Sat, 26 Nov 2022 13:29:48 

irqchip/wpcm450: Fix memory leak in wpcm450_aic_of_init()

If of_iomap() failed, 'aic' should be freed before return. Otherwise
there is a memory leak.

Fixes: fead4dd49663 ("irqchip: Add driver for WPCM450 interrupt controller")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20221115092532.1704032-1-weiyongjun@huaweicloud.com
---
 drivers/irqchip/irq-wpcm450-aic.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/irqchip/irq-wpcm450-aic.c b/drivers/irqchip/irq-wpcm450-aic.c
index 0dcbeb1..91df62a 100644
--- a/drivers/irqchip/irq-wpcm450-aic.c
+++ b/drivers/irqchip/irq-wpcm450-aic.c
@@ -146,6 +146,7 @@ static int __init wpcm450_aic_of_init(struct device_node *node,
 	aic->regs = of_iomap(node, 0);
 	if (!aic->regs) {
 		pr_err("Failed to map WPCM450 AIC registers\n");
+		kfree(aic);
 		return -ENOMEM;
 	}
 

      parent reply	other threads:[~2022-11-26 13:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-15  9:25 [PATCH v2] irqchip/wpcm450: fix " Wei Yongjun
2022-11-15 16:57 ` Jonathan Neuschäfer
2022-11-26 13:34 ` irqchip-bot for Wei Yongjun [this message]

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=166946966925.4906.3717360312262701265.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=j.neuschaefer@gmx.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=weiyongjun1@huawei.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

all inboxes | Powered by JetHome®