mfd: intel-lpss: Don't fail probe on success of pci_alloc_irq_vectors()
Andy Shevchenko
reviewerPATCH 1/1 mfd: intel-lpss: Don't fail probe on success of pci_alloc_irq_vectors()
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.
--- drivers/mfd/intel-lpss-pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/intel-lpss-pci.c +1 -1
@@ -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 );
Signature · 1 line
2.43.0.rc1.1.gbec44491f096
Quoted 7 lines · Andy Shevchenko
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 <[email protected]>Signed-off-by Andy Shevchenko <[email protected]>
Thanks for the quick fix.
Quoted 9 lines
--- drivers/mfd/intel-lpss-pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/mfd/intel-lpss-pci.c +0
-0
drivers/mfd/intel-lpss-pci.c static int intel_lpss_pci_probe(struct pci_dev *pdev, · line 50
Quoted 8 lines
drivers/mfd/intel-lpss-pci.c +1
-1@@ -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 );
thanks,
Signature · 1 line
heikki
Re: (subset) [PATCH v1 1/1] mfd: intel-lpss: Don't fail probe on success of pci_alloc_irq_vectors()
In reply to Andy ShevchenkoQuoted 5 lines · Andy Shevchenko
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.
Applied, thanks!
[1/1] mfd: intel-lpss: Don't fail probe on success of pci_alloc_irq_vectors()
commit: d1432c3fc6c1d6a3fe9ab20332ac01336ee98371
--
Lee Jones [李琼斯]