Skip to content

Commit cf59f34

Browse files
William Deanhdeller
authored andcommitted
parisc: Check the return value of ioremap() in lba_driver_probe()
The function ioremap() in lba_driver_probe() can fail, so its return value should be checked. Fixes: 4bdc0d6 ("remove ioremap_nocache and devm_ioremap_nocache") Reported-by: Hacash Robot <hacashRobot@santino.com> Signed-off-by: William Dean <williamsukatube@gmail.com> Signed-off-by: Helge Deller <deller@gmx.de> Cc: <stable@vger.kernel.org> # v5.6+
1 parent 3fbc9a7 commit cf59f34

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/parisc/lba_pci.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1476,9 +1476,13 @@ lba_driver_probe(struct parisc_device *dev)
14761476
u32 func_class;
14771477
void *tmp_obj;
14781478
char *version;
1479-
void __iomem *addr = ioremap(dev->hpa.start, 4096);
1479+
void __iomem *addr;
14801480
int max;
14811481

1482+
addr = ioremap(dev->hpa.start, 4096);
1483+
if (addr == NULL)
1484+
return -ENOMEM;
1485+
14821486
/* Read HW Rev First */
14831487
func_class = READ_REG32(addr + LBA_FCLASS);
14841488

0 commit comments

Comments
 (0)