提交 c3423563 编写于 作者: C Christoph Hellwig 提交者: Greg Kroah-Hartman

vmw_vmci: handle the return value from pci_alloc_irq_vectors correctly

It returns the number of vectors allocated when successful, so check for
a negative error only.

Fixes: 3bb434cd ("vmw_vmci: switch to pci_irq_alloc_vectors")
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Reported-by: NLoïc Yhuel <loic.yhuel@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 9a69645d
...@@ -566,10 +566,10 @@ static int vmci_guest_probe_device(struct pci_dev *pdev, ...@@ -566,10 +566,10 @@ static int vmci_guest_probe_device(struct pci_dev *pdev,
*/ */
error = pci_alloc_irq_vectors(pdev, VMCI_MAX_INTRS, VMCI_MAX_INTRS, error = pci_alloc_irq_vectors(pdev, VMCI_MAX_INTRS, VMCI_MAX_INTRS,
PCI_IRQ_MSIX); PCI_IRQ_MSIX);
if (error) { if (error < 0) {
error = pci_alloc_irq_vectors(pdev, 1, 1, error = pci_alloc_irq_vectors(pdev, 1, 1,
PCI_IRQ_MSIX | PCI_IRQ_MSI | PCI_IRQ_LEGACY); PCI_IRQ_MSIX | PCI_IRQ_MSI | PCI_IRQ_LEGACY);
if (error) if (error < 0)
goto err_remove_bitmap; goto err_remove_bitmap;
} else { } else {
vmci_dev->exclusive_vectors = true; vmci_dev->exclusive_vectors = true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册