[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <70afefa0-2f18-c8c0-33cd-f6abd4010535@gmx.de>
Date: Tue, 26 Jul 2022 10:27:30 +0200
From: Helge Deller <deller@....de>
To: williamsukatube@....com, James.Bottomley@...senPartnership.com,
linux-parisc@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: William Dean <williamsukatube@...il.com>,
Hacash Robot <hacashRobot@...tino.com>
Subject: Re: [PATCH] parisc: check the return value of ioremap() in
lba_driver_probe()
On 7/22/22 04:57, williamsukatube@....com wrote:
> From: William Dean <williamsukatube@...il.com>
>
> The function ioremap() in lba_driver_probe() can fail, so
> its return value should be checked.
>
> Fixes: 4bdc0d676a643 ("remove ioremap_nocache and devm_ioremap_nocache")
> Reported-by: Hacash Robot <hacashRobot@...tino.com>
> Signed-off-by: William Dean <williamsukatube@...il.com>
applied.
Thanks!
Helge
> ---
> drivers/parisc/lba_pci.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c
> index 732b516c7bf8..afc6e66ddc31 100644
> --- a/drivers/parisc/lba_pci.c
> +++ b/drivers/parisc/lba_pci.c
> @@ -1476,9 +1476,13 @@ lba_driver_probe(struct parisc_device *dev)
> u32 func_class;
> void *tmp_obj;
> char *version;
> - void __iomem *addr = ioremap(dev->hpa.start, 4096);
> + void __iomem *addr;
> int max;
>
> + addr = ioremap(dev->hpa.start, 4096);
> + if (addr == NULL)
> + return -ENOMEM;
> +
> /* Read HW Rev First */
> func_class = READ_REG32(addr + LBA_FCLASS);
>
Powered by blists - more mailing lists