From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from 82-68-191-81.dsl.posilan.com ([82.68.191.81]:51290 "EHLO rainbowdash.ducie.codethink.co.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753821AbaA1KHD (ORCPT ); Tue, 28 Jan 2014 05:07:03 -0500 From: Ben Dooks To: linux-kernel@lists.codethink.co.uk Cc: linux-sh@vger.kernel.org, Bjorn Helgaas , Simon Horman , Valentine Barshak , linux-pci@vger.kernel.org, Ben Dooks Subject: [PATCH 1/3] PCI: rcar: check platform_get_irq() return code Date: Tue, 28 Jan 2014 10:06:54 +0000 Message-Id: <1390903616-8073-2-git-send-email-ben.dooks@codethink.co.uk> In-Reply-To: <1390903616-8073-1-git-send-email-ben.dooks@codethink.co.uk> References: <1390903616-8073-1-git-send-email-ben.dooks@codethink.co.uk> Sender: linux-pci-owner@vger.kernel.org List-ID: 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 --- Cc: Valentine Barshak Cc: Simon Horman Cc: Bjorn Helgaas Cc: linux-pci@vger.kernel.org Cc: linux-sh@vger.kernel.org --- drivers/pci/host/pci-rcar-gen2.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/pci/host/pci-rcar-gen2.c b/drivers/pci/host/pci-rcar-gen2.c index ea65bac..674f7fe 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); } -- 1.8.5.2