[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAhSdy2Xdh+jYgQ8pz9XewZSUVty0t=XUx8J8ecmHm_joCTOGw@mail.gmail.com>
Date: Tue, 20 Aug 2024 16:34:26 +0530
From: Anup Patel <anup@...infault.org>
To: Jinjie Ruan <ruanjinjie@...wei.com>
Cc: tglx@...utronix.de, paul.walmsley@...ive.com, samuel.holland@...ive.com,
apatel@...tanamicro.com, linux-kernel@...r.kernel.org,
linux-riscv@...ts.infradead.org
Subject: Re: [PATCH -next] irqchip/sifive-plic: Fix IS_ERR() vs NULL bug in plic_probe()
On Tue, Aug 20, 2024 at 3:09 PM Jinjie Ruan <ruanjinjie@...wei.com> wrote:
>
> The devm_platform_ioremap_resource() function returns error pointers.
> It never returns NULL. Update the check accordingly.
>
> Fixes: b68d0ff529a9 ("irqchip/sifive-plic: Use devm_xyz() for managed allocation")
> Cc: <stable@...r.kernel.org>
> Signed-off-by: Jinjie Ruan <ruanjinjie@...wei.com>
LGTM.
Reviewed-by: Anup Patel <anup@...infault.org>
Regards,
Anup
> ---
> drivers/irqchip/irq-sifive-plic.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/irqchip/irq-sifive-plic.c b/drivers/irqchip/irq-sifive-plic.c
> index 9e22f7e378f5..cea8dca89c50 100644
> --- a/drivers/irqchip/irq-sifive-plic.c
> +++ b/drivers/irqchip/irq-sifive-plic.c
> @@ -511,8 +511,8 @@ static int plic_probe(struct platform_device *pdev)
> priv->nr_irqs = nr_irqs;
>
> priv->regs = devm_platform_ioremap_resource(pdev, 0);
> - if (WARN_ON(!priv->regs))
> - return -EIO;
> + if (WARN_ON(IS_ERR(priv->regs)))
> + return PTR_ERR(priv->regs);
>
> priv->prio_save = devm_bitmap_zalloc(dev, nr_irqs, GFP_KERNEL);
> if (!priv->prio_save)
> --
> 2.34.1
>
>
Powered by blists - more mailing lists