diff options
author | Dan Williams <dan.j.williams@intel.com> | 2011-04-20 12:57:08 -0700 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2011-07-03 04:00:37 -0700 |
commit | 2d70de5a0f03072289015917b059c155936c894d (patch) | |
tree | 1ccb3f5d30ac13b05c42d2fcd43c289987f590e0 /drivers/scsi/isci/init.c | |
parent | f22be5d8386d9da67bfe02693806fbaff7b078da (diff) |
isci: validate oem parameters early, and fallback
If the platform specifies invalid parameters warn the user and fallback to
internal defaults rather than fail the driver load altogether.
Reported-by: Yinghai Lu <yinghai.lu@oracle.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/scsi/isci/init.c')
-rw-r--r-- | drivers/scsi/isci/init.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/scsi/isci/init.c b/drivers/scsi/isci/init.c index 5da9a6925cd..015ce94453b 100644 --- a/drivers/scsi/isci/init.c +++ b/drivers/scsi/isci/init.c @@ -489,6 +489,16 @@ static int __devinit isci_pci_probe(struct pci_dev *pdev, const struct pci_devic else orom = isci_request_oprom(pdev); + for (i = 0; orom && i < ARRAY_SIZE(orom->ctrl); i++) { + if (scic_oem_parameters_validate(&orom->ctrl[i])) { + dev_warn(&pdev->dev, + "[%d]: invalid oem parameters detected, falling back to firmware\n", i); + devm_kfree(&pdev->dev, orom); + orom = NULL; + break; + } + } + if (!orom) { source = "(firmware)"; orom = isci_request_firmware(pdev, fw); |