aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2012-04-30 11:57:44 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-06-01 15:13:00 +0800
commit923744e41efb5c8bddf6e466835adb0c2d2e63e9 (patch)
treef5842b327199b6fb9edcf0922d2cf8760a5ec4b9 /drivers/scsi
parent6115b7a54b2a3f0b6fc783715f606d3760962dc9 (diff)
downloadkernel_samsung_smdk4412-923744e41efb5c8bddf6e466835adb0c2d2e63e9.tar.gz
kernel_samsung_smdk4412-923744e41efb5c8bddf6e466835adb0c2d2e63e9.tar.bz2
kernel_samsung_smdk4412-923744e41efb5c8bddf6e466835adb0c2d2e63e9.zip
isci: fix oem parameter validation on single controller skus
commit fc25f79af321c01a739150ba2c09435cf977a63d upstream. OEM parameters [1] are parsed from the platform option-rom / efi driver. By default the driver was validating the parameters for the dual-controller case, but in single-controller case only the first set of parameters may be valid. Limit the validation to the number of actual controllers detected otherwise the driver may fail to parse the valid parameters leading to driver-load or runtime failures. [1] the platform specific set of phy address, configuration,and analog tuning values Reported-by: Dave Jiang <dave.jiang@intel.com> Tested-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> [bwh: Backported to 3.2: adjust context] Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/isci/init.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/isci/init.c b/drivers/scsi/isci/init.c
index 61e0d09e2b5..71b57ec3d93 100644
--- a/drivers/scsi/isci/init.c
+++ b/drivers/scsi/isci/init.c
@@ -454,7 +454,7 @@ static int __devinit isci_pci_probe(struct pci_dev *pdev, const struct pci_devic
if (!orom)
orom = isci_request_oprom(pdev);
- for (i = 0; orom && i < ARRAY_SIZE(orom->ctrl); i++) {
+ for (i = 0; orom && i < num_controllers(pdev); i++) {
if (sci_oem_parameters_validate(&orom->ctrl[i])) {
dev_warn(&pdev->dev,
"[%d]: invalid oem parameters detected, falling back to firmware\n", i);