Skip to contentSkip to conversation

vmw_pvscsi: handle the return value from pci_alloc_irq_vectors correctly

PATCH Applied Christoph Hellwig 2 participants 2 messages Mar 3, 2017 – Mar 7, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vmw_pvscsi: 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 2e48e349 ("scsi: vmw_pvscsi: switch to pci_alloc_irq_vectors")
---
 drivers/scsi/vmw_pvscsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/vmw_pvscsi.c +1 -1
index ef474a748744..c374e3b5c678 100644
@@ -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);
Signature · 1 line
2.11.0
#1 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Christoph" == Christoph Hellwig <[email protected]> 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.

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering