diff options
author | Christoph Hellwig <hch@lst.de> | 2017-03-03 07:58:06 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-03-16 17:32:21 +0900 |
commit | c3423563c68fc454b805b46cb69fd4816db933e2 (patch) | |
tree | 8f9e88266690a6cfd9b192771bd4c113c8a1baeb /drivers/misc | |
parent | 9a69645dde1188723d80745c1bc6ee9af2cbe2a7 (diff) | |
download | talos-obmc-linux-c3423563c68fc454b805b46cb69fd4816db933e2.tar.gz talos-obmc-linux-c3423563c68fc454b805b46cb69fd4816db933e2.zip |
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: Christoph Hellwig <hch@lst.de>
Reported-by: Loïc Yhuel <loic.yhuel@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/vmw_vmci/vmci_guest.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/misc/vmw_vmci/vmci_guest.c b/drivers/misc/vmw_vmci/vmci_guest.c index 9d659542a335..dad5abee656e 100644 --- a/drivers/misc/vmw_vmci/vmci_guest.c +++ b/drivers/misc/vmw_vmci/vmci_guest.c @@ -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, PCI_IRQ_MSIX); - if (error) { + if (error < 0) { error = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_MSIX | PCI_IRQ_MSI | PCI_IRQ_LEGACY); - if (error) + if (error < 0) goto err_remove_bitmap; } else { vmci_dev->exclusive_vectors = true; |