PCI: rcar: Check platform_get_irq() return code
authorBen Dooks <ben.dooks@codethink.co.uk>
Tue, 18 Feb 2014 02:10:51 +0000 (11:10 +0900)
committerSimon Horman <horms+renesas@verge.net.au>
Fri, 5 Dec 2014 04:13:21 +0000 (13:13 +0900)
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 <ben.dooks@codethink.co.uk>
Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit ed65b78881c713b41051310780f94bde3c010db9)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
drivers/pci/host/pci-rcar-gen2.c

index ceec147..201e4a4 100644 (file)
@@ -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);
 }