[PATCH] scsi: sun3x_esp: check the return value of ioremap() in esp_sun3x_probe()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Xie Shaowen <studentxswpy@xxxxxxx>

The function ioremap() in esp_sun3x_probe() can fail, so
its return value should be checked.

Fixes: 4bdc0d676a643 ("remove ioremap_nocache and devm_ioremap_nocache")
Reported-by: Hacash Robot <hacashRobot@xxxxxxxxxxx>
Signed-off-by: Xie Shaowen <studentxswpy@xxxxxxx>
---
 drivers/scsi/sun3x_esp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/scsi/sun3x_esp.c b/drivers/scsi/sun3x_esp.c
index d3489ac7ab28..cc670b50a357 100644
--- a/drivers/scsi/sun3x_esp.c
+++ b/drivers/scsi/sun3x_esp.c
@@ -199,6 +199,8 @@ static int esp_sun3x_probe(struct platform_device *dev)
 		goto fail_unmap_regs;
 
 	esp->dma_regs = ioremap(res->start, 0x10);
+	if (!esp->dma_regs)
+		goto fail_unmap_regs;
 
 	esp->command_block = dma_alloc_coherent(esp->dev, 16,
 						&esp->command_block_dma,
-- 
2.25.1




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux