From patchwork Tue Oct 31 12:23:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jie Hai X-Patchwork-Id: 133664 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4D34843252; Tue, 31 Oct 2023 13:36:06 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2224140E36; Tue, 31 Oct 2023 13:35:46 +0100 (CET) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id 9285A40633 for ; Tue, 31 Oct 2023 13:35:41 +0100 (CET) Received: from kwepemi500020.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4SKTxs3VTJzvQ7Q for ; Tue, 31 Oct 2023 20:30:41 +0800 (CST) Received: from localhost.localdomain (10.67.165.2) by kwepemi500020.china.huawei.com (7.221.188.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Tue, 31 Oct 2023 20:35:40 +0800 From: Jie Hai To: , Yisen Zhuang , Dongdong Liu , Huisong Li CC: Subject: [PATCH 6/6] net/hns3: fix uninitialized value Date: Tue, 31 Oct 2023 20:23:59 +0800 Message-ID: <20231031122359.3930935-7-haijie1@huawei.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20231031122359.3930935-1-haijie1@huawei.com> References: <20231031122359.3930935-1-haijie1@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.165.2] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemi500020.china.huawei.com (7.221.188.8) X-CFilter-Loop: Reflected X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org This patch initializes "hash_algo" as zero to avoid using it uninitialized. Fixes: e3069658da9f ("net/hns3: reimplement hash flow function" Cc: stable@dpdk.org Signed-off-by: Jie Hai --- drivers/net/hns3/hns3_rss.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c index 9bb84262563c..eeeca71a5c1a 100644 --- a/drivers/net/hns3/hns3_rss.c +++ b/drivers/net/hns3/hns3_rss.c @@ -771,7 +771,7 @@ hns3_dev_rss_hash_conf_get(struct rte_eth_dev *dev, { struct hns3_adapter *hns = dev->data->dev_private; struct hns3_hw *hw = &hns->hw; - uint8_t hash_algo; + uint8_t hash_algo = 0; int ret; rte_spinlock_lock(&hw->lock); @@ -993,7 +993,7 @@ hns3_update_rss_algo_key(struct hns3_hw *hw, uint8_t hash_func, { uint8_t rss_key[HNS3_RSS_KEY_SIZE_MAX] = {0}; bool modify_key, modify_algo; - uint8_t hash_algo; + uint8_t hash_algo = 0; int ret; modify_key = (key != NULL && key_len > 0);