1 Star 0 Fork 75

sky/dpdk

forked from src-openEuler/dpdk 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0383-net-hns3-fix-uninitialized-hash-algo-value.patch 1.25 KB
一键复制 编辑 原始数据 按行查看 历史
huangdengdui 提交于 2023-11-20 17:28 . sync some patchs from upstreaming
From f99da9ff1fd939d98025625bca3986054f00592e Mon Sep 17 00:00:00 2001
From: Jie Hai <haijie1@huawei.com>
Date: Tue, 31 Oct 2023 20:23:59 +0800
Subject: [PATCH 383/394] net/hns3: fix uninitialized hash algo value
[ upstream commit 177cf5c93f9ac86d8a2b817115ef1e979023414c ]
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>
---
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 9bb8426256..eeeca71a5c 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.23.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/nlgwcy/dpdk.git
git@gitee.com:nlgwcy/dpdk.git
nlgwcy
dpdk
dpdk
master

搜索帮助