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>
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user