Skip to content

Commit

Permalink
net/hns3: fix uninitialized hash algo value
Browse files Browse the repository at this point in the history
[ upstream commit 177cf5c93f9ac86d8a2b817115ef1e979023414c ]

This patch initializes "hash_algo" as zero to avoid using
it uninitialized.

Fixes: e3069658da9f ("net/hns3: reimplement hash flow function")

Signed-off-by: Jie Hai <haijie1@huawei.com>
  • Loading branch information
Jie Hai authored and bluca committed Nov 8, 2023
1 parent 0b6d1e0 commit ca5911f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/hns3/hns3_rss.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit ca5911f

Please sign in to comment.