This patch initializes "hash_algo" as zero to avoid using it uninitialized.
Fixes: e3069658da9f ("net/hns3: reimplement hash flow function" Cc: sta...@dpdk.org Signed-off-by: Jie Hai <haij...@huawei.com> --- 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); -- 2.30.0