* [PATCH] vmw_vmci: handle the return value from pci_alloc_irq_vectors correctly
@ 2017-03-03 14:58 Christoph Hellwig
0 siblings, 0 replies; only message in thread
From: Christoph Hellwig @ 2017-03-03 14:58 UTC (permalink / raw)
To: gregkh; +Cc: linux-kernel, loic.yhuel
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>
---
drivers/misc/vmw_vmci/vmci_guest.c | 4 ++--
1 file 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;
--
2.11.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-03-03 15:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-03 14:58 [PATCH] vmw_vmci: handle the return value from pci_alloc_irq_vectors correctly Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®