mfd: intel-lpss: Don't fail probe on success of pci_alloc_irq_vectors()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 30 Nov 2023 14:32:06 +0000 (16:32 +0200)
committerLee Jones <lee@kernel.org>
Thu, 7 Dec 2023 13:50:30 +0000 (13:50 +0000)
The pci_alloc_irq_vectors() returns a positive number on success.
Hence we have to filter the negative numbers for error condition.
Update the check accordingly.

Fixes: e6951fb78787 ("mfd: intel-lpss: Use PCI APIs instead of dereferencing")
Reported-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20231130143206.1475831-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/mfd/intel-lpss-pci.c

index 8f5e10817a9c56e68ecd671a49fb5e5a62f45d02..4621d3950b8f9fab4c3ccc2ad650f14cf07c2749 100644 (file)
@@ -44,7 +44,7 @@ static int intel_lpss_pci_probe(struct pci_dev *pdev,
                return ret;
 
        ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_LEGACY);
-       if (ret)
+       if (ret < 0)
                return ret;
 
        info = devm_kmemdup(&pdev->dev, data, sizeof(*info), GFP_KERNEL);