From: Alexandre Ghiti <alex@ghiti.fr>
To: Qingfang Deng <dqfext@gmail.com>,
Thomas Gleixner <tglx@linutronix.de>,
Palmer Dabbelt <palmer@dabbelt.com>,
Paul Walmsley <paul.walmsley@sifive.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Atish Patra <atishp@atishpatra.org>,
linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org
Cc: Christoph Hellwig <hch@lst.de>,
Qingfang Deng <qingfang.deng@siflower.com.cn>
Subject: Re: [PATCH] irqchip/sifive-plic: Fix error handling of of_property_read_u32
Date: Fri, 22 Mar 2024 18:08:55 +0100 [thread overview]
Message-ID: <0a1e9afc-e999-451f-8d4f-670f7c15e609@ghiti.fr> (raw)
In-Reply-To: <20240322090002.311645-1-dqfext@gmail.com>
Hi Qingfang,
On 22/03/2024 10:00, Qingfang Deng wrote:
> From: Qingfang Deng <qingfang.deng@siflower.com.cn>
>
> nr_irqs will not be initialized if of_property_read_u32 returns an
> error. Check the error first.
>
> Fixes: 8237f8bc4f6e ("irqchip: add a SiFive PLIC driver")
> Signed-off-by: Qingfang Deng <qingfang.deng@siflower.com.cn>
> ---
> drivers/irqchip/irq-sifive-plic.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/irqchip/irq-sifive-plic.c b/drivers/irqchip/irq-sifive-plic.c
> index 5b7bc4fd9517..f436b61d74b0 100644
> --- a/drivers/irqchip/irq-sifive-plic.c
> +++ b/drivers/irqchip/irq-sifive-plic.c
> @@ -428,8 +428,11 @@ static int __init __plic_init(struct device_node *node,
> goto out_free_priv;
> }
>
> + error = of_property_read_u32(node, "riscv,ndev", &nr_irqs);
> + if (error)
> + goto out_iounmap;
> +
> error = -EINVAL;
> - of_property_read_u32(node, "riscv,ndev", &nr_irqs);
> if (WARN_ON(!nr_irqs))
> goto out_iounmap;
>
You can add:
Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Thanks,
Alex
next prev parent reply other threads:[~2024-03-22 17:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-22 9:00 Qingfang Deng
2024-03-22 17:08 ` Alexandre Ghiti [this message]
2024-03-25 20:45 ` Alexandre Ghiti
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=0a1e9afc-e999-451f-8d4f-670f7c15e609@ghiti.fr \
--to=alex@ghiti.fr \
--cc=aou@eecs.berkeley.edu \
--cc=atishp@atishpatra.org \
--cc=dqfext@gmail.com \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=qingfang.deng@siflower.com.cn \
--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
all inboxes | Powered by JetHome®