Skip to content

Commit

Permalink
parisc: Check the return value of ioremap() in lba_driver_probe()
Browse files Browse the repository at this point in the history
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+
  • Loading branch information
William Dean authored and Helge Deller committed Aug 1, 2022
1 parent 3fbc9a7 commit cf59f34
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/parisc/lba_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit cf59f34

Please sign in to comment.