From: William Dean Date: Fri, 22 Jul 2022 02:57:09 +0000 (+0800) Subject: parisc: Check the return value of ioremap() in lba_driver_probe() X-Git-Tag: v5.15.73~1753 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9b67131162dc112e10a60322eacdaacf47ad1133;p=platform%2Fkernel%2Flinux-rpi.git parisc: Check the return value of ioremap() in lba_driver_probe() commit cf59f34d7f978d14d6520fd80a78a5ad5cb8abf8 upstream. 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 Signed-off-by: William Dean Signed-off-by: Helge Deller Cc: # v5.6+ Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c index 732b516..afc6e66 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);