Commit c12de882e7765585ae3a2ae22aa569285951613a

Authored by Jiang Liu
Committed by Christoph Hellwig
1 parent 7b07bf244a

megaraid_sas: fix bug in handling return value of pci_enable_msix_range()

Function pci_enable_msix_range() may return negative values for error
conditions. So it's a bug by checking (pci_enable_msix_range() != 0)
for success and causes failure to megaraid driver when MSI is disabled.
[   16.487267] megaraid_sas 0000:02:00.0: Controller type: iMR
[   16.487275] genirq: Flags mismatch irq 0. 00000000 (megasas) vs. 00015a00 (tii
mer)
[   16.487347] megasas: Failed to register IRQ for vector 0.

Fixes: 8ae80ed1734b "megaraid: Use pci_enable_msix_range() instead of pci_enable_msix()"

Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Acked-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: <stable@vger.kernel.org> # 3.17

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

drivers/scsi/megaraid/megaraid_sas_base.c
... ... @@ -4453,7 +4453,7 @@
4453 4453 instance->msixentry[i].entry = i;
4454 4454 i = pci_enable_msix_range(instance->pdev, instance->msixentry,
4455 4455 1, instance->msix_vectors);
4456   - if (i)
  4456 + if (i > 0)
4457 4457 instance->msix_vectors = i;
4458 4458 else
4459 4459 instance->msix_vectors = 0;