diff options
Diffstat (limited to 'drivers/pci/pcie')
-rw-r--r-- | drivers/pci/pcie/portdrv_core.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c index 16a1ce4f6b18..986f8eadfd39 100644 --- a/drivers/pci/pcie/portdrv_core.c +++ b/drivers/pci/pcie/portdrv_core.c | |||
@@ -79,9 +79,10 @@ static int pcie_port_enable_msix(struct pci_dev *dev, int *vectors, int mask) | |||
79 | u16 reg16; | 79 | u16 reg16; |
80 | u32 reg32; | 80 | u32 reg32; |
81 | 81 | ||
82 | nr_entries = pci_msix_table_size(dev); | 82 | nr_entries = pci_msix_vec_count(dev); |
83 | if (!nr_entries) | 83 | if (nr_entries < 0) |
84 | return -EINVAL; | 84 | return nr_entries; |
85 | BUG_ON(!nr_entries); | ||
85 | if (nr_entries > PCIE_PORT_MAX_MSIX_ENTRIES) | 86 | if (nr_entries > PCIE_PORT_MAX_MSIX_ENTRIES) |
86 | nr_entries = PCIE_PORT_MAX_MSIX_ENTRIES; | 87 | nr_entries = PCIE_PORT_MAX_MSIX_ENTRIES; |
87 | 88 | ||