Skip to content

Commit 2576e15

Browse files
JiangJiasmartinkpetersen
authored andcommitted
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: 0e6f9d2 ("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>
1 parent 3ba880a commit 2576e15

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/scsi/pcmcia/nsp_cs.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,6 +1557,9 @@ static int nsp_cs_config_check(struct pcmcia_device *p_dev, void *priv_data)
15571557
data->MmioAddress = (unsigned long)
15581558
ioremap(p_dev->resource[2]->start,
15591559
resource_size(p_dev->resource[2]));
1560+
if (!data->MmioAddress)
1561+
goto next_entry;
1562+
15601563
data->MmioLength = resource_size(p_dev->resource[2]);
15611564
}
15621565
/* If we got this far, we're cool! */

0 commit comments

Comments
 (0)