Skip to content

Commit c342356

Browse files
Christoph Hellwiggregkh
authored andcommitted
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: 3bb434c ("vmw_vmci: switch to pci_irq_alloc_vectors") Signed-off-by: Christoph Hellwig <[email protected]> Reported-by: Loïc Yhuel <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 9a69645 commit c342356

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/misc/vmw_vmci/vmci_guest.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -566,10 +566,10 @@ static int vmci_guest_probe_device(struct pci_dev *pdev,
566566
*/
567567
error = pci_alloc_irq_vectors(pdev, VMCI_MAX_INTRS, VMCI_MAX_INTRS,
568568
PCI_IRQ_MSIX);
569-
if (error) {
569+
if (error < 0) {
570570
error = pci_alloc_irq_vectors(pdev, 1, 1,
571571
PCI_IRQ_MSIX | PCI_IRQ_MSI | PCI_IRQ_LEGACY);
572-
if (error)
572+
if (error < 0)
573573
goto err_remove_bitmap;
574574
} else {
575575
vmci_dev->exclusive_vectors = true;

0 commit comments

Comments
 (0)