Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp1601929rwn; Fri, 9 Sep 2022 00:36:20 -0700 (PDT) X-Google-Smtp-Source: AA6agR6Pv+cHmhHhMarFGCLh1p4DTJX60+6Pk2m9FewOSYosOU+lj4f3XEL7goXfKcmlHi1ePXNa X-Received: by 2002:a17:902:d490:b0:177:fc1d:6b0c with SMTP id c16-20020a170902d49000b00177fc1d6b0cmr4489438plg.28.1662708980554; Fri, 09 Sep 2022 00:36:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662708980; cv=none; d=google.com; s=arc-20160816; b=hLACOJCnM0P0YyYLR7FVdWch55kS/nomcp9GMZtBF+QrAlLGdhxQ+uKuEXlHnnGaVH yTHN3So5oacpuEtU+PZCZKTlZOGxeDJ8UE2se26zDDP/iDKtReiPwNsKX4UzH7chB0n4 lHgLxPOW6iq77qy3U5ISidPkO+tcfucdh+U7HI+nL0fIBEqKUuzLTCDETzMMNz/TXWTI CHkDNdji/8VNslEFv8ilgMlv/wbB9WPZtHsTzb32UgFMlpchqK8I3qHqkIoFt/al22KE ImBghf56jjmZT5sMjNfzyXXupYyoyfLs8pV02fRxW/UdJtHpL13SBekwGEncmrCNHW5h r07g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=8zsbXX+sy1QDIQnmiq2GbBvhvlCaSeebJZ2f6J8/gX4=; b=GFRm5v1yV3xkzjMdzQZGDJaHPA1zLGPPbwQECAaZEIH/d4kgNCcEfwZyn73aUGjsmk kLo1QIhg7DXga/JBsm02NnzjQSp9adqIqjKuowmaM8I2iZxLsWDuOJS+8+gis9/oaYBT X5IZPTTIME0T97vccnMrVeAGmmOc/b/JsApL1rPxL/6HYfq312xI2jSbg+1tBhjiW3xu zBrmiLCEWeLGJrgSs5TXTR/+fdMwh4SUDcYZPkwyiQ40degp2lMR5GsY9M7gMTGaRZob PO4HgYC1F651qAM/J2fWkzKqrkZnhi2S3L5LKIW9hYEWmoWrrh4ielKn6KU88JuB7fJS zoGg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w23-20020a63d757000000b004305c5d804fsi635452pgi.114.2022.09.09.00.36.06; Fri, 09 Sep 2022 00:36:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230466AbiIIG0z (ORCPT + 99 others); Fri, 9 Sep 2022 02:26:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230426AbiIIG0w (ORCPT ); Fri, 9 Sep 2022 02:26:52 -0400 Received: from mail.nfschina.com (mail.nfschina.com [124.16.136.209]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 647481269F7; Thu, 8 Sep 2022 23:26:50 -0700 (PDT) Received: from localhost (unknown [127.0.0.1]) by mail.nfschina.com (Postfix) with ESMTP id 6EDC61E80D5E; Fri, 9 Sep 2022 14:25:19 +0800 (CST) X-Virus-Scanned: amavisd-new at test.com Received: from mail.nfschina.com ([127.0.0.1]) by localhost (mail.nfschina.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qC0r7odWaN2A; Fri, 9 Sep 2022 14:25:16 +0800 (CST) Received: from localhost.localdomain (unknown [180.167.10.98]) (Authenticated sender: yuzhe@nfschina.com) by mail.nfschina.com (Postfix) with ESMTPA id 50AF21E80D06; Fri, 9 Sep 2022 14:25:16 +0800 (CST) From: Yu Zhe To: rafal@milecki.pl, bcm-kernel-feedback-list@broadcom.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, liqiong@nfschina.com, Yu Zhe Subject: [PATCH] net: broadcom: bcm4908enet: add platform_get_irq_byname error checking Date: Fri, 9 Sep 2022 14:25:45 +0800 Message-Id: <20220909062545.16696-1-yuzhe@nfschina.com> X-Mailer: git-send-email 2.11.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The platform_get_irq_byname() function returns negative error codes on error, check it. Signed-off-by: Yu Zhe --- drivers/net/ethernet/broadcom/bcm4908_enet.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/broadcom/bcm4908_enet.c b/drivers/net/ethernet/broadcom/bcm4908_enet.c index c131d8118489..d985056db6c2 100644 --- a/drivers/net/ethernet/broadcom/bcm4908_enet.c +++ b/drivers/net/ethernet/broadcom/bcm4908_enet.c @@ -705,6 +705,8 @@ static int bcm4908_enet_probe(struct platform_device *pdev) return netdev->irq; enet->irq_tx = platform_get_irq_byname(pdev, "tx"); + if (enet->irq_tx < 0) + return enet->irq_tx; err = dma_set_coherent_mask(dev, DMA_BIT_MASK(32)); if (err) -- 2.11.0