Commit 2576e153 authored by 蒋家盛's avatar 蒋家盛 Committed by Martin K. Petersen
Browse files

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: 0e6f9d27 ("pcmcia: use pcmcia_loop_config in scsi pcmcia drivers")
Signed-off-by: default avatarJiasheng Jiang <jiasheng@iscas.ac.cn>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 3ba880a1
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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! */