summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiang Liu <jiang.liu@linux.intel.com>2014-11-03 20:44:20 +0800
committerChristoph Hellwig <hch@lst.de>2014-11-10 15:25:41 +0100
commitc12de882e7765585ae3a2ae22aa569285951613a (patch)
treece25e64b82f526a40cdf90500a35d6e414d72a0f
parent7b07bf244ae33e4ce8d51c23f1359121942a6f3e (diff)
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
-rw-r--r--drivers/scsi/megaraid/megaraid_sas_base.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index f6a69a3b1b3f..5640ad1c8214 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -4453,7 +4453,7 @@ static int megasas_init_fw(struct megasas_instance *instance)
instance->msixentry[i].entry = i;
i = pci_enable_msix_range(instance->pdev, instance->msixentry,
1, instance->msix_vectors);
- if (i)
+ if (i > 0)
instance->msix_vectors = i;
else
instance->msix_vectors = 0;