aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Jiang <dave.jiang@intel.com>2012-01-27 11:17:37 -0800
committerJames Bottomley <JBottomley@Parallels.com>2012-02-18 08:37:00 -0600
commit6d7938f46f89c9773f9396c1d13b20bbc5c6d95b (patch)
treeaac6b7756ec3952caf5a9c1b96822eaacf3cb77c
parenta92fa25c63a788758bd52e9123504d133210c8b7 (diff)
[SCSI] isci: Fix NULL ptr dereference when no firmware is being loaded
NULL orom ptr passed in for verification which caused page fault. We will set a default version when we don't have orom struct. Reported-by: Dan Melnic <dan@seamicro.com> Signed-off-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r--drivers/scsi/isci/host.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/scsi/isci/host.c b/drivers/scsi/isci/host.c
index 1a65d651423..418391b1c36 100644
--- a/drivers/scsi/isci/host.c
+++ b/drivers/scsi/isci/host.c
@@ -1848,9 +1848,11 @@ static enum sci_status sci_oem_parameters_set(struct isci_host *ihost)
if (state == SCIC_RESET ||
state == SCIC_INITIALIZING ||
state == SCIC_INITIALIZED) {
+ u8 oem_version = pci_info->orom ? pci_info->orom->hdr.version :
+ ISCI_ROM_VER_1_0;
if (sci_oem_parameters_validate(&ihost->oem_parameters,
- pci_info->orom->hdr.version))
+ oem_version))
return SCI_FAILURE_INVALID_PARAMETER_VALUE;
return SCI_SUCCESS;