From patchwork Wed Feb 10 07:46:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 12080001 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1539CC433DB for ; Wed, 10 Feb 2021 07:38:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CA82764E3B for ; Wed, 10 Feb 2021 07:38:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232736AbhBJHiZ (ORCPT ); Wed, 10 Feb 2021 02:38:25 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:12890 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232538AbhBJHiV (ORCPT ); Wed, 10 Feb 2021 02:38:21 -0500 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4DbBQS00GXz7jRK; Wed, 10 Feb 2021 15:36:15 +0800 (CST) Received: from localhost.localdomain (10.175.102.38) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.498.0; Wed, 10 Feb 2021 15:37:32 +0800 From: Wei Yongjun To: Hulk Robot , Saeed Mahameed , "Leon Romanovsky" , Vlad Buslov , Jakub Kicinski CC: Wei Yongjun , , Subject: [PATCH net-next] net/mlx5e: Fix error return code in mlx5e_tc_esw_init() Date: Wed, 10 Feb 2021 07:46:05 +0000 Message-ID: <20210210074605.867456-1-weiyongjun1@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.175.102.38] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Fix to return negative error code from the mlx5e_tc_tun_init() error handling case instead of 0, as done elsewhere in this function. This commit also using 0 instead of 'ret' when success since it is always equal to 0. Fixes: 8914add2c9e5 ("net/mlx5e: Handle FIB events to update tunnel endpoint device") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun --- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c index db142ee96510..9f126054d371 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c @@ -4750,10 +4750,12 @@ int mlx5e_tc_esw_init(struct rhashtable *tc_ht) lockdep_set_class(&tc_ht->mutex, &tc_ht_lock_key); uplink_priv->encap = mlx5e_tc_tun_init(priv); - if (IS_ERR(uplink_priv->encap)) + if (IS_ERR(uplink_priv->encap)) { + err = PTR_ERR(uplink_priv->encap); goto err_register_fib_notifier; + } - return err; + return 0; err_register_fib_notifier: rhashtable_destroy(tc_ht);