[PATCH 2/5] pci: added check for return value of platform_get_irq

From: Aman Sharma
Date: Wed Mar 11 2020 - 15:19:27 EST


Signed-off-by: Aman Sharma <amanharitsh123@xxxxxxxxx>
---
drivers/pci/controller/pci-aardvark.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/pci/controller/pci-aardvark.c b/drivers/pci/controller/pci-aardvark.c
index 2a20b649f40c..40a4257f0df1 100644
--- a/drivers/pci/controller/pci-aardvark.c
+++ b/drivers/pci/controller/pci-aardvark.c
@@ -973,6 +973,9 @@ static int advk_pcie_probe(struct platform_device *pdev)
return PTR_ERR(pcie->base);

irq = platform_get_irq(pdev, 0);
+ if (irq < 0)
+ return irq;
+
ret = devm_request_irq(dev, irq, advk_pcie_irq_handler,
IRQF_SHARED | IRQF_NO_THREAD, "advk-pcie",
pcie);
--
2.20.1