[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y3PE7vU6nfe4fqHU@probook>
Date: Tue, 15 Nov 2022 17:57:18 +0100
From: Jonathan Neuschäfer <j.neuschaefer@....net>
To: Wei Yongjun <weiyongjun@...weicloud.com>
Cc: Jonathan Neuschäfer <j.neuschaefer@....net>,
Thomas Gleixner <tglx@...utronix.de>,
Marc Zyngier <maz@...nel.org>,
Wei Yongjun <weiyongjun1@...wei.com>, openbmc@...ts.ozlabs.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] irqchip/wpcm450: fix memory leak in
wpcm450_aic_of_init()
On Tue, Nov 15, 2022 at 09:25:32AM +0000, Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@...wei.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@...wei.com>
Reviewed-by: Jonathan Neuschäfer <j.neuschaefer@....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
>
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists