Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752630AbdLBT1U (ORCPT ); Sat, 2 Dec 2017 14:27:20 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:36499 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752580AbdLBT1H (ORCPT ); Sat, 2 Dec 2017 14:27:07 -0500 X-Google-Smtp-Source: AGs4zMaVpJk00p57hE5+qmGKq4bvf8nxMc5jhiD/XdTnuYpjGijB2Tlf/s879A2/8QewQRwdsj/MJA== 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 10/10] net: ethernet: cpmac: Handle return value of platform_get_irq_byname Date: Sun, 3 Dec 2017 00:56:22 +0530 Message-Id: <1512242782-7134-11-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: 680 Lines: 25 platform_get_irq_byname() can fail here and we must check its return value Signed-off-by: Arvind Yadav --- drivers/net/ethernet/ti/cpmac.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/ti/cpmac.c b/drivers/net/ethernet/ti/cpmac.c index 9b8a30b..f3acfc0 100644 --- a/drivers/net/ethernet/ti/cpmac.c +++ b/drivers/net/ethernet/ti/cpmac.c @@ -1124,6 +1124,10 @@ static int cpmac_probe(struct platform_device *pdev) } dev->irq = platform_get_irq_byname(pdev, "irq"); + if (dev->irq < 0) { + rc = dev->irq; + goto fail; + } dev->netdev_ops = &cpmac_netdev_ops; dev->ethtool_ops = &cpmac_ethtool_ops; -- 2.7.4