Skip to content

Commit

Permalink
vmw_vmci: handle the return value from pci_alloc_irq_vectors correctly
Browse files Browse the repository at this point in the history
It returns the number of vectors allocated when successful, so check for
a negative error only.

Fixes: 3bb434c ("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>
  • Loading branch information
Christoph Hellwig authored and Greg Kroah-Hartman committed Mar 16, 2017
1 parent 9a69645 commit c342356
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/misc/vmw_vmci/vmci_guest.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c342356

Please sign in to comment.