diff mbox

mpt3sas: Abort initialization if no memory I/O resources detected

Message ID 1741634911.3158.1435087958045.JavaMail.zimbra@raptorengineeringinc.com (mailing list archive)
State New, archived
Headers show

Commit Message

Timothy Pearson June 23, 2015, 7:32 p.m. UTC
The mpt3sas driver crashes if the BIOS does not set up at least one
memory I/O resource.  This failure can happen if the device is too
slow to respond during POST and is missed by the BIOS, but Linux
then detects the device later in the boot process.

Signed-off-by: Timothy Pearson <tpearson@raptorengineeringinc.com>
---
 drivers/scsi/mpt3sas/mpt3sas_base.c |    7 +++++++
 1 file changed, 7 insertions(+)
diff mbox

Patch

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
index 14a781b..4460d48 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -1865,6 +1865,13 @@  mpt3sas_base_map_resources(struct MPT3SAS_ADAPTER *ioc)
 		}
 	}
 
+	if (ioc->chip == NULL) {
+		printk(MPT3SAS_FMT "unable to map "
+			"adapter memory (resource not found)!\n", ioc->name);
+		r = -EINVAL;
+		goto out_fail;
+	}
+
 	_base_mask_interrupts(ioc);
 
 	r = _base_get_ioc_facts(ioc, CAN_SLEEP);