From: Jie Hai <haijie1@huawei.com>
To: <dev@dpdk.org>, Yisen Zhuang <yisen.zhuang@huawei.com>,
Dongdong Liu <liudongdong3@huawei.com>,
Huisong Li <lihuisong@huawei.com>
Cc: <fengchengwen@huawei.com>
Subject: [PATCH 6/6] net/hns3: fix uninitialized value
Date: Tue, 31 Oct 2023 20:23:59 +0800 [thread overview]
Message-ID: <20231031122359.3930935-7-haijie1@huawei.com> (raw)
In-Reply-To: <20231031122359.3930935-1-haijie1@huawei.com>
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 <haijie1@huawei.com>
---
| 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--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);
--
2.30.0
next prev parent reply other threads:[~2023-10-31 12:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-31 12:23 [PATCH 0/6] net/hns3: add some bugfix for hns3 Jie Hai
2023-10-31 12:23 ` [PATCH 1/6] net/hns3: fix setting DCB capability Jie Hai
2023-10-31 12:23 ` [PATCH 2/6] net/hns3: fix LRO offload to report Jie Hai
2023-10-31 12:23 ` [PATCH 3/6] net/hns3: fix return value Jie Hai
2023-10-31 12:23 ` [PATCH 4/6] net/hns3: fix some error log Jie Hai
2023-10-31 12:23 ` [PATCH 5/6] net/hns3: do not export API for setting and getting algo and key Jie Hai
2023-10-31 12:23 ` Jie Hai [this message]
2023-11-01 21:40 ` [PATCH 0/6] net/hns3: add some bugfix for hns3 Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231031122359.3930935-7-haijie1@huawei.com \
--to=haijie1@huawei.com \
--cc=dev@dpdk.org \
--cc=fengchengwen@huawei.com \
--cc=lihuisong@huawei.com \
--cc=liudongdong3@huawei.com \
--cc=yisen.zhuang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).