Skip to content

Commit ee40fb2

Browse files
committed
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
2 parents b987c75 + ea1a25c commit ee40fb2

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

drivers/scsi/ipr.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10093,6 +10093,7 @@ static int ipr_probe_ioa(struct pci_dev *pdev,
1009310093
ioa_cfg->intr_flag = IPR_USE_MSI;
1009410094
else {
1009510095
ioa_cfg->intr_flag = IPR_USE_LSI;
10096+
ioa_cfg->clear_isr = 1;
1009610097
ioa_cfg->nvectors = 1;
1009710098
dev_info(&pdev->dev, "Cannot enable MSI.\n");
1009810099
}

drivers/scsi/qla2xxx/qla_isr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2548,7 +2548,7 @@ void qla24xx_process_response_queue(struct scsi_qla_host *vha,
25482548
if (!vha->flags.online)
25492549
return;
25502550

2551-
if (rsp->msix->cpuid != smp_processor_id()) {
2551+
if (rsp->msix && rsp->msix->cpuid != smp_processor_id()) {
25522552
/* if kernel does not notify qla of IRQ's CPU change,
25532553
* then set it here.
25542554
*/

drivers/scsi/scsi_devinfo.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ static struct scsi_dev_info_list *scsi_dev_info_list_find(const char *vendor,
429429
* here, and we don't know what device it is
430430
* trying to work with, leave it as-is.
431431
*/
432-
vmax = 8; /* max length of vendor */
432+
vmax = sizeof(devinfo->vendor);
433433
vskip = vendor;
434434
while (vmax > 0 && *vskip == ' ') {
435435
vmax--;
@@ -439,7 +439,7 @@ static struct scsi_dev_info_list *scsi_dev_info_list_find(const char *vendor,
439439
while (vmax > 0 && vskip[vmax - 1] == ' ')
440440
--vmax;
441441

442-
mmax = 16; /* max length of model */
442+
mmax = sizeof(devinfo->model);
443443
mskip = model;
444444
while (mmax > 0 && *mskip == ' ') {
445445
mmax--;
@@ -455,10 +455,12 @@ static struct scsi_dev_info_list *scsi_dev_info_list_find(const char *vendor,
455455
* Behave like the older version of get_device_flags.
456456
*/
457457
if (memcmp(devinfo->vendor, vskip, vmax) ||
458-
devinfo->vendor[vmax])
458+
(vmax < sizeof(devinfo->vendor) &&
459+
devinfo->vendor[vmax]))
459460
continue;
460461
if (memcmp(devinfo->model, mskip, mmax) ||
461-
devinfo->model[mmax])
462+
(mmax < sizeof(devinfo->model) &&
463+
devinfo->model[mmax]))
462464
continue;
463465
return devinfo;
464466
} else {

0 commit comments

Comments
 (0)