From patchwork Thu Nov 10 13:47:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yue Haibing X-Patchwork-Id: 18136 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp156269wru; Thu, 10 Nov 2022 05:48:19 -0800 (PST) X-Google-Smtp-Source: AMsMyM4x0Nvh84tcWaGeqJiM7+ealCrphKjnsZM73A27j2JskpGGsMFRKuh2giotMOHAmIB6Hl9h X-Received: by 2002:a05:6a00:999:b0:56c:3d0d:96fe with SMTP id u25-20020a056a00099900b0056c3d0d96femr65128391pfg.12.1668088099289; Thu, 10 Nov 2022 05:48:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668088099; cv=none; d=google.com; s=arc-20160816; b=jQdhA/i6R0IRKOgyhP8+81PBmRxr5XeMo2zU/phoel09GnlwFQqCQr2rSp0AWl2Z6f +KYhpucTKGvnjLHeKfFbv5d9QldzrnM4eVek0xrZrKJZhuntc0OM/8k3EmvrRF7am31z rYzELSTo9uOpW+717RWnChLvahz4CaRkRoiiM9O/Z6NNsB+E0JTLs0keEe2aybz/+sSe xNQkGpECFNoNdg1nuhgaG9esLM5Ld7xs5x739bdePErZ8YoHot6z1EkQcvpCt9b413I0 adEZRMTzrqtdJRwmsIKaTESOBJxUt7zySQngXGNGSXEfDqcLqxLNnfYpZiA8cU4JXgr7 8YMg== 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=jaG/Kvfp6WsoCWzPSGNVASU0ux1QpECO7tYMRm5hK3A=; b=Mwahc56jDUwBalw4MCqBDNVSWVAn+Z4z7S3wB366Fzvap8VshWwVKeqBxOHtRd66/B 0TKbs+//9I+7zjRkELT5bEAQTmUTV4mFfZgJr8WTUOCO5AtLR/KdM7fGeJCJaZXbtpVB Z93ZCa1BxUX0aAldo3mNB1a2y8SkKX0H93yh6PjGBC17fMgnJzrot3f1i25XXoeyrCKY sqZ7t1VK1eissxUaQIBfILUEKh4g+tn/TNFpnyvitpPGb3e1HbeYVPy/SsuH6sgiL7j4 Uq+lFvFOHZ4GfP/ZJ0MpogR8LfZ9cSDj2C3q+pahnWYogI6zDeiGy+cCbn0PS73qJEvB Xbdw== 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 f16-20020a63f110000000b0047063e59929si15704979pgi.836.2022.11.10.05.48.02; Thu, 10 Nov 2022 05:48:19 -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 S231194AbiKJNrY (ORCPT + 99 others); Thu, 10 Nov 2022 08:47:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229586AbiKJNrW (ORCPT ); Thu, 10 Nov 2022 08:47:22 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7971461745; Thu, 10 Nov 2022 05:47:21 -0800 (PST) Received: from canpemm500007.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4N7NRf0ZjMzHvjP; Thu, 10 Nov 2022 21:46:54 +0800 (CST) Received: from localhost (10.174.179.215) by canpemm500007.china.huawei.com (7.192.104.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 10 Nov 2022 21:47:19 +0800 From: YueHaibing To: , , , , , , , , , , CC: , , , YueHaibing Subject: [PATCH v2] net/mlx5: DR, Fix uninitialized var warning Date: Thu, 10 Nov 2022 21:47:07 +0800 Message-ID: <20221110134707.43740-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.174.179.215] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To canpemm500007.china.huawei.com (7.192.104.62) 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748892236947662210?= X-GMAIL-MSGID: =?utf-8?q?1749117146738793217?= Smatch warns this: drivers/net/ethernet/mellanox/mlx5/core/steering/dr_table.c:81 mlx5dr_table_set_miss_action() error: uninitialized symbol 'ret'. Initializing ret with -EOPNOTSUPP and fix missing action case. Fixes: 7838e1725394 ("net/mlx5: DR, Expose steering table functionality") Signed-off-by: YueHaibing Reviewed-by: Roi Dayan --- v2: init ret to -EOPNOTSUPP --- drivers/net/ethernet/mellanox/mlx5/core/steering/dr_table.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_table.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_table.c index eb81759244d5..7cc4cb7fa392 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_table.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_table.c @@ -46,7 +46,7 @@ static int dr_table_set_miss_action_nic(struct mlx5dr_domain *dmn, int mlx5dr_table_set_miss_action(struct mlx5dr_table *tbl, struct mlx5dr_action *action) { - int ret; + int ret = -EOPNOTSUPP; if (action && action->action_type != DR_ACTION_TYP_FT) return -EOPNOTSUPP; @@ -67,6 +67,9 @@ int mlx5dr_table_set_miss_action(struct mlx5dr_table *tbl, goto out; } + if (ret) + goto out; + /* Release old action */ if (tbl->miss_action) refcount_dec(&tbl->miss_action->refcount);