Skip to content

Commit 9b67131

Browse files
William Deangregkh
authored andcommitted
parisc: Check the return value of ioremap() in lba_driver_probe()
commit cf59f34 upstream. 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 <[email protected]> Signed-off-by: William Dean <[email protected]> Signed-off-by: Helge Deller <[email protected]> Cc: <[email protected]> # v5.6+ Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 68949e7 commit 9b67131

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)