From: Christoph Hellwig Date: Fri, 3 Mar 2017 14:57:16 +0000 (-0700) Subject: scsi: vmw_pvscsi: handle the return value from pci_alloc_irq_vectors correctly X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c527de41aea24c2cdb6638818008d810013b4d39;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git scsi: 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") Signed-off-by: Christoph Hellwig Reported-by: Loïc Yhuel Tested-by: Loïc Yhuel Signed-off-by: Martin K. Petersen --- 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);