[v2,08/11] net/hns3: fix uninitialized variable

Message ID 20230602114205.29589-9-liudongdong3@huawei.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net/hns3: add some bugfixes for hns3 |

Checks

Context Check Description
ci/checkpatch warning coding style issues

Commit Message

Dongdong Liu June 2, 2023, 11:42 a.m. UTC
From: Jie Hai <haijie1@huawei.com>

This patch fixes possible use of uninitialized variable
"old_tuple_fields".

Fixes: e3069658da9f ("net/hns3: reimplement hash flow function")
Cc: stable@dpdk.org

Signed-off-by: Jie Hai <haijie1@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_flow.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
  

Patch

diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index e132d88fa1..a5a7e452d8 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1944,8 +1944,9 @@  hns3_flow_set_rss_ptype_tuple(struct hns3_hw *hw,
 	if (ret != 0)
 		return ret;
 
-	hns3_info(hw, "RSS tuple fields changed from 0x%" PRIx64 " to 0x%" PRIx64,
-		  old_tuple_fields, new_tuple_fields);
+	if (!cfg_global_tuple)
+		hns3_info(hw, "RSS tuple fields changed from 0x%" PRIx64 " to 0x%" PRIx64,
+			  old_tuple_fields, new_tuple_fields);
 
 	return 0;
 }