[net] net: marvell: prestera: add missing unregister_netdev() in prestera_port_create()
Message ID | 1669115432-36841-1-git-send-email-zhangchangzhong@huawei.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2137401wrr; Tue, 22 Nov 2022 03:14:43 -0800 (PST) X-Google-Smtp-Source: AA0mqf7cUYOimZwzvfyn2TM/vFVhC5IqY4T9FitkzuocbIG+PBO1nB/PI/1ATJbpqmmmPC5rUXZb X-Received: by 2002:a05:6402:3893:b0:461:b033:90ac with SMTP id fd19-20020a056402389300b00461b03390acmr8839572edb.257.1669115683559; Tue, 22 Nov 2022 03:14:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669115683; cv=none; d=google.com; s=arc-20160816; b=FYuM4eQszyYNcrI/N2FLfU7TM3ZgKYtux/E2+swgZK6hCC9A82ng1hmWT+t/Sy39JC vJZcJKReDz56g9UVoQFbuc9JtFOS75nS1OlZeCU2jdyrh6vwObT2I0ercbQAHLaqlngd G+12K7ssiO64iWVpvklRZCuf2elscLL+ia8sxZpLt36blb7BSiwxVdHRNG6srGA5kg3X S19ShOWAc3OfnFVgErK3G8+3f6re9KjEgOFlvCT7C8jpd+PR9mdcM2VJAmBfg4dfewbn bkmx3f+IAIUzTeBPwunLfkV3EJQSYpr39pQEFQA0MWzAdkHnNu3NptaxCav8pAujsIwR gmHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=E8SUtBAY1LM8nvVd0G+WOhkdQ3IDM15q0+rCvtFF0zM=; b=dtTAhgOQ+hvrBEbOqcIAUZrIO4rHCN0mevcekeSFITdiMl2jvVrXO0Yyj9fpk5kGWP 84fa878TfSEp3TZQJV0gtldcMj+CrOcOdG4B7Zel2vxJ3PjuM4H4Rz8OISDa5nTqPyPO j8jfdk/8uBFSBReO4Shfdg6XOnikVObtF8bZxRjtFEyRBWiyfzrGz7yorQtjSA9wVjXR y/rXu8F2uLVYg/Doi4fEDcb5iKIolUD3wlynR7oeb7PQLrRgl+jOF2QShlNsqHDnc5oS I29Fn1Gjqz/xeg6bDD9jLPQKIfceORXyk0lvu1jIAxlCo/zgjlW+t7Ii64g8nzfv7bGn 4rhg== 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sa24-20020a1709076d1800b007a39ad3da43si1542713ejc.714.2022.11.22.03.14.17; Tue, 22 Nov 2022 03:14:43 -0800 (PST) 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232128AbiKVKuc (ORCPT <rfc822;cjcooper78@gmail.com> + 99 others); Tue, 22 Nov 2022 05:50:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231655AbiKVKu2 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 22 Nov 2022 05:50:28 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E3C4C52; Tue, 22 Nov 2022 02:50:27 -0800 (PST) Received: from dggpeml500021.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4NGgxw2ZdgzRpPH; Tue, 22 Nov 2022 18:49:56 +0800 (CST) Received: from dggpeml500006.china.huawei.com (7.185.36.76) by dggpeml500021.china.huawei.com (7.185.36.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 22 Nov 2022 18:50:24 +0800 Received: from localhost.localdomain (10.175.112.70) by dggpeml500006.china.huawei.com (7.185.36.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 22 Nov 2022 18:50:24 +0800 From: Zhang Changzhong <zhangchangzhong@huawei.com> To: Taras Chornyi <tchornyi@marvell.com>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Oleksandr Mazur <oleksandr.mazur@plvision.eu>, Yevhen Orlov <yevhen.orlov@plvision.eu> CC: Zhang Changzhong <zhangchangzhong@huawei.com>, <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org> Subject: [PATCH net] net: marvell: prestera: add missing unregister_netdev() in prestera_port_create() Date: Tue, 22 Nov 2022 19:10:31 +0800 Message-ID: <1669115432-36841-1-git-send-email-zhangchangzhong@huawei.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.112.70] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpeml500006.china.huawei.com (7.185.36.76) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750194647155388306?= X-GMAIL-MSGID: =?utf-8?q?1750194647155388306?= |
Series |
[net] net: marvell: prestera: add missing unregister_netdev() in prestera_port_create()
|
|
Commit Message
Zhang Changzhong
Nov. 22, 2022, 11:10 a.m. UTC
If prestera_port_sfp_bind() fails, unregister_netdev() should be called
in error handling path.
Compile tested only.
Fixes: 52323ef75414 ("net: marvell: prestera: add phylink support")
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
---
drivers/net/ethernet/marvell/prestera/prestera_main.c | 1 +
1 file changed, 1 insertion(+)
Comments
On Tue, Nov 22, 2022 at 07:10:31PM +0800, Zhang Changzhong wrote: > If prestera_port_sfp_bind() fails, unregister_netdev() should be called > in error handling path. > > Compile tested only. > > Fixes: 52323ef75414 ("net: marvell: prestera: add phylink support") > Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com> Makes sense and fixes commit is correct. Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com> > --- > drivers/net/ethernet/marvell/prestera/prestera_main.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/net/ethernet/marvell/prestera/prestera_main.c b/drivers/net/ethernet/marvell/prestera/prestera_main.c > index 24f9d60..47796e4 100644 > --- a/drivers/net/ethernet/marvell/prestera/prestera_main.c > +++ b/drivers/net/ethernet/marvell/prestera/prestera_main.c > @@ -746,6 +746,7 @@ static int prestera_port_create(struct prestera_switch *sw, u32 id) > return 0; > > err_sfp_bind: > + unregister_netdev(dev); > err_register_netdev: > prestera_port_list_del(port); > err_port_init: > -- > 2.9.5 >
Hello: This patch was applied to netdev/net.git (master) by Jakub Kicinski <kuba@kernel.org>: On Tue, 22 Nov 2022 19:10:31 +0800 you wrote: > If prestera_port_sfp_bind() fails, unregister_netdev() should be called > in error handling path. > > Compile tested only. > > Fixes: 52323ef75414 ("net: marvell: prestera: add phylink support") > Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com> > > [...] Here is the summary with links: - [net] net: marvell: prestera: add missing unregister_netdev() in prestera_port_create() https://git.kernel.org/netdev/net/c/9a234a2a085a You are awesome, thank you!
diff --git a/drivers/net/ethernet/marvell/prestera/prestera_main.c b/drivers/net/ethernet/marvell/prestera/prestera_main.c index 24f9d60..47796e4 100644 --- a/drivers/net/ethernet/marvell/prestera/prestera_main.c +++ b/drivers/net/ethernet/marvell/prestera/prestera_main.c @@ -746,6 +746,7 @@ static int prestera_port_create(struct prestera_switch *sw, u32 id) return 0; err_sfp_bind: + unregister_netdev(dev); err_register_netdev: prestera_port_list_del(port); err_port_init: