[PATCH net 1/3] net: hns3: fix a use of uninitialized variable problem
From: Jijie Shao
Date: Wed Apr 02 2025 - 08:16:57 EST
From: Yonglong Liu <liuyonglong@xxxxxxxxxx>
In hclge_add_fd_entry(), if the flow type is FLOW_EXT, and the data of
m_ext is all zero, then some members of the local variable "info" are
not initialized.
Fixes: 67b0e1428e2f ("net: hns3: add support for user-def data of flow director")
Signed-off-by: Yonglong Liu <liuyonglong@xxxxxxxxxx>
Signed-off-by: Jijie Shao <shaojijie@xxxxxxxxxx>
---
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index 92f9b8ec76d9..f61355b03e14 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -6545,8 +6545,8 @@ static int hclge_add_fd_entry(struct hnae3_handle *handle,
struct ethtool_rxnfc *cmd)
{
struct hclge_vport *vport = hclge_get_vport(handle);
+ struct hclge_fd_user_def_info info = {0};
struct hclge_dev *hdev = vport->back;
- struct hclge_fd_user_def_info info;
u16 dst_vport_id = 0, q_index = 0;
struct ethtool_rx_flow_spec *fs;
struct hclge_fd_rule *rule;
--
2.33.0