Skip to contentSkip to conversation

PCI: rcar: check platform_get_irq() return code

PATCH In review Ben Dooks 1 participant 1 message Feb 5, 2014

Subsystems (3)
lore
Share & tools
lore

Ben Dooks

author
#0 lore raw

PATCH 9/11 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.

---
Cc: Valentine Barshak <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: Bjorn Helgaas <[email protected]>
Cc: [email protected]
Cc: [email protected]

---
 drivers/pci/host/pci-rcar-gen2.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/pci/host/pci-rcar-gen2.c +5 -0
index ea65bac..674f7fe 100644
@@ -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);
 }
 
Signature · 1 line
1.8.5.3