Commit cf59f34d authored by William Dean's avatar William Dean Committed by Helge Deller
Browse files

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: 4bdc0d67 ("remove ioremap_nocache and devm_ioremap_nocache")
Reported-by: default avatarHacash Robot <hacashRobot@santino.com>
Signed-off-by: default avatarWilliam Dean <williamsukatube@gmail.com>
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
Cc: <stable@vger.kernel.org> # v5.6+
parent 3fbc9a7d
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -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);