public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
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] irqchip/wpcm450: fix memory leak in ap_init_qci_info()
Date: Tue, 15 Nov 2022 09:36:01 +0100	[thread overview]
Message-ID: <Y3NPcfuS9M6BSoEW@probook> (raw)
In-Reply-To: <20221114110854.554220-1-weiyongjun@huaweicloud.com>

[-- Attachment #1: Type: text/plain, Size: 1057 bytes --]

Hi,

the function name is wrong in the in the subject line. Other than that,
the patch looks good.

Thanks,
Jonathan


On Mon, Nov 14, 2022 at 11:08:54AM +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>
> ---
>  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 --]

  reply	other threads:[~2022-11-15  8:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-14 11:08 [PATCH] irqchip/wpcm450: fix memory leak in ap_init_qci_info() Wei Yongjun
2022-11-15  8:36 ` Jonathan Neuschäfer [this message]
2022-11-15  9:10   ` 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=Y3NPcfuS9M6BSoEW@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