From: "Jonathan Neuschäfer" <j.neuschaefer@gmx.net>
To: Wei Yongjun <weiyongjun@huaweicloud.com>
Cc: "Jonathan Neuschäfer" <j.neuschaefer@gmx.net>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Marc Zyngier" <maz@kernel.org>,
"Wei Yongjun" <weiyongjun1@huawei.com>,
openbmc@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] irqchip/wpcm450: fix memory leak in wpcm450_aic_of_init()
Date: Tue, 15 Nov 2022 17:57:18 +0100 [thread overview]
Message-ID: <Y3PE7vU6nfe4fqHU@probook> (raw)
In-Reply-To: <20221115092532.1704032-1-weiyongjun@huaweicloud.com>
[-- Attachment #1: Type: text/plain, Size: 1051 bytes --]
On Tue, Nov 15, 2022 at 09:25:32AM +0000, Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
>
> 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>
Thanks.
> ---
> v1 -> v2: fix function name in subject
>
> 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 0dcbeb1a05a1..91df62a64cd9 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;
> }
>
> --
> 2.34.1
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2022-11-15 16:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-15 9:25 [PATCH v2] irqchip/wpcm450: fix memory leak in wpcm450_aic_of_init() Wei Yongjun
2022-11-15 16:57 ` Jonathan Neuschäfer [this message]
2022-11-26 13:34 ` [irqchip: irq/irqchip-next] irqchip/wpcm450: Fix " irqchip-bot for Wei Yongjun
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=Y3PE7vU6nfe4fqHU@probook \
--to=j.neuschaefer@gmx.net \
--cc=linux-kernel@vger.kernel.org \
--cc=maz@kernel.org \
--cc=openbmc@lists.ozlabs.org \
--cc=tglx@linutronix.de \
--cc=weiyongjun1@huawei.com \
--cc=weiyongjun@huaweicloud.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