From patchwork Sat May 15 07:16:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen \(ThunderTown\)" X-Patchwork-Id: 439432 Delivered-To: patch@linaro.org Received: by 2002:a02:b78d:0:0:0:0:0 with SMTP id f13csp961453jam; Sat, 15 May 2021 00:16:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwuus5bLgCmYOHENOdGo/Fm9g+7kN3WtfeV4WFncpievEgL/3xgQP7E7e/NT5L8O3MF1y9S X-Received: by 2002:a05:6e02:80b:: with SMTP id u11mr45151799ilm.153.1621062986583; Sat, 15 May 2021 00:16:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621062986; cv=none; d=google.com; s=arc-20160816; b=IgTd+uaAodwb8akuLJTwizZl4yPu9mVoX8pANIzBWhOHtCe4kD1TwAFoi9AuegR9SV /YPZAMeItnUIs2J6HLAe3uGWHHofdx5ArNG89Rwq84AUumLZDdyCTEi1SAg4UKJB0aCU dM1u8cats0H0lhJIe36rPA/LURD8A/eoKGcjGwxhIOsUlXhcYyl10Im+WAXDpVWJ6ueG KCX5nMIE5p7cmGpzcwXygCNs6OmeRELnr02bcEv87lyMW8dmO23xflIEjWVeOsjJFlj8 WuNMBosJ5EtJeYEqohHzF/2XMAeAkHfYKadD8Z0c8xiiG0fp1eVFLPx4zbayJkIi5mG8 wJ6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=zVZwnty/oGP+T4HuP1vuBvEjFOMYO1ZMoyGbbixiGWs=; b=fUMghg4471zK91WJJzaQ/EyDKe881hzzQ4oFpeKVZJQ8u3r9UPrucp0qLA1/9O24Of xniT4FTUcmB+I8iuY9rxXvDg0HzJTPUckcXsWc/+Bk4o0b4XOkUtX/BlemAhhfDpWxn8 9chsIYfSjSs24PRefJJplwowNQzU4N8jugtr2J9c0aq0VePNYLlNIiePi4/XIMk8wut3 X+Y40FuWQvX6lN7af037Z/xG+z31C9qyC1b/E01FCm7ckNSNIV3RHyoQH768H7r4evNg QEvJAO0y40Wh+fU4OIRmTjYjfG42K8pFYohOjzX4SS2Z/CJ3KAGd3ku1QaQR4np+E9fo fU2A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p15si9952149jas.109.2021.05.15.00.16.25; Sat, 15 May 2021 00:16:26 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232974AbhEOHRb (ORCPT + 8 others); Sat, 15 May 2021 03:17:31 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:3691 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232796AbhEOHRb (ORCPT ); Sat, 15 May 2021 03:17:31 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4FhxSt4vq2z16QCw; Sat, 15 May 2021 15:13:34 +0800 (CST) Received: from thunder-town.china.huawei.com (10.174.177.72) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.498.0; Sat, 15 May 2021 15:16:10 +0800 From: Zhen Lei To: Rasesh Mody , GR-Linux-NIC-Dev , "David S . Miller" , Jakub Kicinski , Michael Chan , netdev CC: Zhen Lei Subject: [PATCH 1/1] net: bnx2: Fix error return code in bnx2_init_board() Date: Sat, 15 May 2021 15:16:05 +0800 Message-ID: <20210515071605.7098-1-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.174.177.72] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Fix to return -EPERM from the error handling case instead of 0, as done elsewhere in this function. Fixes: b6016b767397 ("[BNX2]: New Broadcom gigabit network driver.") Reported-by: Hulk Robot Signed-off-by: Zhen Lei --- drivers/net/ethernet/broadcom/bnx2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.26.0.106.g9fadedd Reviewed-by: Michael Chan diff --git a/drivers/net/ethernet/broadcom/bnx2.c b/drivers/net/ethernet/broadcom/bnx2.c index c0986096c701d36..5bace8a93d73be5 100644 --- a/drivers/net/ethernet/broadcom/bnx2.c +++ b/drivers/net/ethernet/broadcom/bnx2.c @@ -8247,9 +8247,9 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) BNX2_WR(bp, PCI_COMMAND, reg); } else if ((BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5706_A1) && !(bp->flags & BNX2_FLAG_PCIX)) { - dev_err(&pdev->dev, "5706 A1 can only be used in a PCIX bus, aborting\n"); + rc = -EPERM; goto err_out_unmap; }