summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiasheng Jiang <jiasheng@iscas.ac.cn>2021-12-30 05:11:37 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2022-01-10 19:03:42 +0300
commit2576e153cd982d540b212e989458edc42ad1b390 (patch)
tree338a2378e590bd245b87d951fe43ae51a2ad6835
parent3ba880a12df5aa4488c18281701b5b1bc3d4531a (diff)
downloadlinux-2576e153cd982d540b212e989458edc42ad1b390.tar.xz
scsi: nsp_cs: Check of ioremap return value
Since it is possible for ioremap() to fail, 'data->MmioAddress' could be NULL. Skip entry if ioremap() fails. Link: https://lore.kernel.org/r/20211230021137.1823352-1-jiasheng@iscas.ac.cn Fixes: 0e6f9d270840 ("pcmcia: use pcmcia_loop_config in scsi pcmcia drivers") Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r--drivers/scsi/pcmcia/nsp_cs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c
index 8b9e889bc306..92c818a8a84a 100644
--- a/drivers/scsi/pcmcia/nsp_cs.c
+++ b/drivers/scsi/pcmcia/nsp_cs.c
@@ -1557,6 +1557,9 @@ static int nsp_cs_config_check(struct pcmcia_device *p_dev, void *priv_data)
data->MmioAddress = (unsigned long)
ioremap(p_dev->resource[2]->start,
resource_size(p_dev->resource[2]));
+ if (!data->MmioAddress)
+ goto next_entry;
+
data->MmioLength = resource_size(p_dev->resource[2]);
}
/* If we got this far, we're cool! */