From: Ben Dooks Date: Tue, 18 Feb 2014 02:10:51 +0000 (+0900) Subject: PCI: rcar: Check platform_get_irq() return code X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ed65b78881c713b41051310780f94bde3c010db9;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git PCI: rcar: Check platform_get_irq() return code The current code does not check the return from platform_get_irq() so add an error check and return if this call does fail. Signed-off-by: Ben Dooks Signed-off-by: Magnus Damm Signed-off-by: Bjorn Helgaas Acked-by: Simon Horman --- diff --git a/drivers/pci/host/pci-rcar-gen2.c b/drivers/pci/host/pci-rcar-gen2.c index ceec147baec3..201e4a450340 100644 --- a/drivers/pci/host/pci-rcar-gen2.c +++ b/drivers/pci/host/pci-rcar-gen2.c @@ -308,6 +308,11 @@ static int __init rcar_pci_probe(struct platform_device *pdev) priv->reg = reg; priv->dev = &pdev->dev; + if (priv->irq < 0) { + dev_err(&pdev->dev, "no valid irq found\n"); + return priv->irq; + } + return rcar_pci_add_controller(priv); }