public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vmw_pvscsi: handle the return value from pci_alloc_irq_vectors correctly
@ 2017-03-03 14:57 Christoph Hellwig
  2017-03-07  3:27 ` Martin K. Petersen
  0 siblings, 1 reply; 2+ messages in thread
From: Christoph Hellwig @ 2017-03-03 14:57 UTC (permalink / raw)
  To: linux-scsi; +Cc: loic.yhuel

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

Fixes: 2e48e349 ("scsi: vmw_pvscsi: switch to pci_alloc_irq_vectors")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reported-by: Loïc Yhuel <loic.yhuel@gmail.com>
Tested-by: Loïc Yhuel <loic.yhuel@gmail.com>
---
 drivers/scsi/vmw_pvscsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/vmw_pvscsi.c b/drivers/scsi/vmw_pvscsi.c
index ef474a748744..c374e3b5c678 100644
--- a/drivers/scsi/vmw_pvscsi.c
+++ b/drivers/scsi/vmw_pvscsi.c
@@ -1487,7 +1487,7 @@ static int pvscsi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 		irq_flag &= ~PCI_IRQ_MSI;
 
 	error = pci_alloc_irq_vectors(adapter->dev, 1, 1, irq_flag);
-	if (error)
+	if (error < 0)
 		goto out_reset_adapter;
 
 	adapter->use_req_threshold = pvscsi_setup_req_threshold(adapter, true);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] vmw_pvscsi: handle the return value from pci_alloc_irq_vectors correctly
  2017-03-03 14:57 [PATCH] vmw_pvscsi: handle the return value from pci_alloc_irq_vectors correctly Christoph Hellwig
@ 2017-03-07  3:27 ` Martin K. Petersen
  0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2017-03-07  3:27 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: linux-scsi, loic.yhuel

>>>>> "Christoph" == Christoph Hellwig <hch@lst.de> writes:

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

Applied to 4.11/scsi-fixes.

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-07  3:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-03 14:57 [PATCH] vmw_pvscsi: handle the return value from pci_alloc_irq_vectors correctly Christoph Hellwig
2017-03-07  3:27 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox