Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752602AbdLBT1I (ORCPT ); Sat, 2 Dec 2017 14:27:08 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:42237 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752073AbdLBT1E (ORCPT ); Sat, 2 Dec 2017 14:27:04 -0500 X-Google-Smtp-Source: AGs4zMbachQ5DScqu6fIGTVu9K0pPOsiWkTCjx/gIUIy5aPfyaTZ14613bcbfulplw0z4Ac2LOeG1A== From: Arvind Yadav To: wg@grandegger.com, mkl@pengutronix.de, michal.simek@xilinx.com, opendmb@gmail.com, f.fainelli@gmail.com, davem@davemloft.net, Vladislav.Zakharov@synopsys.com Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org Subject: [PATCH 09/10] net: ethernet: korina: Handle return value of platform_get_irq_byname Date: Sun, 3 Dec 2017 00:56:21 +0530 Message-Id: <1512242782-7134-10-git-send-email-arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512242782-7134-1-git-send-email-arvind.yadav.cs@gmail.com> References: <1512242782-7134-1-git-send-email-arvind.yadav.cs@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 893 Lines: 31 platform_get_irq_byname() can fail here and we must check its return value. Signed-off-by: Arvind Yadav --- drivers/net/ethernet/korina.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/ethernet/korina.c b/drivers/net/ethernet/korina.c index ae195f8..e778504 100644 --- a/drivers/net/ethernet/korina.c +++ b/drivers/net/ethernet/korina.c @@ -1039,7 +1039,16 @@ static int korina_probe(struct platform_device *pdev) memcpy(dev->dev_addr, bif->mac, ETH_ALEN); lp->rx_irq = platform_get_irq_byname(pdev, "korina_rx"); + if (lp->rx_irq < 0) { + rc = lp->rx_irq; + goto probe_err_out; + } + lp->tx_irq = platform_get_irq_byname(pdev, "korina_tx"); + if (lp->tx_irq < 0) { + rc = lp->tx_irq; + goto probe_err_out; + } r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "korina_regs"); dev->base_addr = r->start; -- 2.7.4