Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: fnic: fix msix interrupt allocation

pci_alloc_irq_vectors() returns number of vectors allocated. Fix the check
for error condition.

Fixes: cca678dfbad49 ("scsi: fnic: switch to pci_alloc_irq_vectors")
Link: https://lore.kernel.org/r/20190827211340.1095-1-gvaradar@cisco.com
Signed-off-by: Govindarajulu Varadarajan <gvaradar@cisco.com>
Acked-by: Satish Kharat <satishkh@cisco.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Govindarajulu Varadarajan and committed by
Martin K. Petersen
3ec24fb4 90302e95

+2 -2
+2 -2
drivers/scsi/fnic/fnic_isr.c
··· 254 254 int vecs = n + m + o + 1; 255 255 256 256 if (pci_alloc_irq_vectors(fnic->pdev, vecs, vecs, 257 - PCI_IRQ_MSIX) < 0) { 257 + PCI_IRQ_MSIX) == vecs) { 258 258 fnic->rq_count = n; 259 259 fnic->raw_wq_count = m; 260 260 fnic->wq_copy_count = o; ··· 280 280 fnic->wq_copy_count >= 1 && 281 281 fnic->cq_count >= 3 && 282 282 fnic->intr_count >= 1 && 283 - pci_alloc_irq_vectors(fnic->pdev, 1, 1, PCI_IRQ_MSI) < 0) { 283 + pci_alloc_irq_vectors(fnic->pdev, 1, 1, PCI_IRQ_MSI) == 1) { 284 284 fnic->rq_count = 1; 285 285 fnic->raw_wq_count = 1; 286 286 fnic->wq_copy_count = 1;