aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-07-08 21:59:46 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-07-08 21:59:46 -0400
commitee40fb2948fc99096836995d4f3ddcc0efbac790 (patch)
treeac448f9645f1a32f65ff56ae109629a847c53f85
parentb987c759d21a1c7551357e3bc74e7f8026e696a2 (diff)
parentea1a25c3348abc33d7d94db28501766adf3d1c7d (diff)
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI fixes from James Bottomley: "Three fixes. One is the qla24xx MSI regression, one is a theoretical problem over blacklist matching, which would bite USB badly if it ever triggered and one is a system hang with a particular type of IPR device" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: qla2xxx: Fix NULL pointer deref in QLA interrupt SCSI: fix new bug in scsi_dev_info_list string matching ipr: Clear interrupt on croc/crocodile when running with LSI
-rw-r--r--drivers/scsi/ipr.c1
-rw-r--r--drivers/scsi/qla2xxx/qla_isr.c2
-rw-r--r--drivers/scsi/scsi_devinfo.c10
3 files changed, 8 insertions, 5 deletions
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index d6a691e27d33..d6803a9e5ab8 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -10093,6 +10093,7 @@ static int ipr_probe_ioa(struct pci_dev *pdev,
10093 ioa_cfg->intr_flag = IPR_USE_MSI; 10093 ioa_cfg->intr_flag = IPR_USE_MSI;
10094 else { 10094 else {
10095 ioa_cfg->intr_flag = IPR_USE_LSI; 10095 ioa_cfg->intr_flag = IPR_USE_LSI;
10096 ioa_cfg->clear_isr = 1;
10096 ioa_cfg->nvectors = 1; 10097 ioa_cfg->nvectors = 1;
10097 dev_info(&pdev->dev, "Cannot enable MSI.\n"); 10098 dev_info(&pdev->dev, "Cannot enable MSI.\n");
10098 } 10099 }
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index 5649c200d37c..a92a62dea793 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -2548,7 +2548,7 @@ void qla24xx_process_response_queue(struct scsi_qla_host *vha,
2548 if (!vha->flags.online) 2548 if (!vha->flags.online)
2549 return; 2549 return;
2550 2550
2551 if (rsp->msix->cpuid != smp_processor_id()) { 2551 if (rsp->msix && rsp->msix->cpuid != smp_processor_id()) {
2552 /* if kernel does not notify qla of IRQ's CPU change, 2552 /* if kernel does not notify qla of IRQ's CPU change,
2553 * then set it here. 2553 * then set it here.
2554 */ 2554 */
diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c
index ff41c310c900..eaccd651ccda 100644
--- a/drivers/scsi/scsi_devinfo.c
+++ b/drivers/scsi/scsi_devinfo.c
@@ -429,7 +429,7 @@ static struct scsi_dev_info_list *scsi_dev_info_list_find(const char *vendor,
429 * here, and we don't know what device it is 429 * here, and we don't know what device it is
430 * trying to work with, leave it as-is. 430 * trying to work with, leave it as-is.
431 */ 431 */
432 vmax = 8; /* max length of vendor */ 432 vmax = sizeof(devinfo->vendor);
433 vskip = vendor; 433 vskip = vendor;
434 while (vmax > 0 && *vskip == ' ') { 434 while (vmax > 0 && *vskip == ' ') {
435 vmax--; 435 vmax--;
@@ -439,7 +439,7 @@ static struct scsi_dev_info_list *scsi_dev_info_list_find(const char *vendor,
439 while (vmax > 0 && vskip[vmax - 1] == ' ') 439 while (vmax > 0 && vskip[vmax - 1] == ' ')
440 --vmax; 440 --vmax;
441 441
442 mmax = 16; /* max length of model */ 442 mmax = sizeof(devinfo->model);
443 mskip = model; 443 mskip = model;
444 while (mmax > 0 && *mskip == ' ') { 444 while (mmax > 0 && *mskip == ' ') {
445 mmax--; 445 mmax--;
@@ -455,10 +455,12 @@ static struct scsi_dev_info_list *scsi_dev_info_list_find(const char *vendor,
455 * Behave like the older version of get_device_flags. 455 * Behave like the older version of get_device_flags.
456 */ 456 */
457 if (memcmp(devinfo->vendor, vskip, vmax) || 457 if (memcmp(devinfo->vendor, vskip, vmax) ||
458 devinfo->vendor[vmax]) 458 (vmax < sizeof(devinfo->vendor) &&
459 devinfo->vendor[vmax]))
459 continue; 460 continue;
460 if (memcmp(devinfo->model, mskip, mmax) || 461 if (memcmp(devinfo->model, mskip, mmax) ||
461 devinfo->model[mmax]) 462 (mmax < sizeof(devinfo->model) &&
463 devinfo->model[mmax]))
462 continue; 464 continue;
463 return devinfo; 465 return devinfo;
464 } else { 466 } else {