net/ixgbe: fix possible uninitialized variable

Message ID 20181222124014.95181-1-haiyangtan@tencent.com (mailing list archive)
State Rejected, archived
Headers
Series net/ixgbe: fix possible uninitialized variable |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/intel-Performance-Testing success Performance Testing PASS
ci/Intel-compilation success Compilation OK

Commit Message

Haiyang Tan Dec. 22, 2018, 12:40 p.m. UTC
  The uninitialized field 'extra_flag' of hash parameter may enable
certain feature silently. Typically, if bit0 of 'extra_flag' set, the
hardware transactional memory support will be enabled unexpectedly.

Signed-off-by: Haiyang Tan <haiyangtan@tencent.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
  

Patch

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 749311048..017d61178 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -1426,14 +1426,14 @@  static int ixgbe_fdir_filter_init(struct rte_eth_dev *eth_dev)
 	struct ixgbe_hw_fdir_info *fdir_info =
 		IXGBE_DEV_PRIVATE_TO_FDIR_INFO(eth_dev->data->dev_private);
 	char fdir_hash_name[RTE_HASH_NAMESIZE];
-	struct rte_hash_parameters fdir_hash_params = {
-		.name = fdir_hash_name,
-		.entries = IXGBE_MAX_FDIR_FILTER_NUM,
-		.key_len = sizeof(union ixgbe_atr_input),
-		.hash_func = rte_hash_crc,
-		.hash_func_init_val = 0,
-		.socket_id = rte_socket_id(),
-	};
+	struct rte_hash_parameters fdir_hash_params = { 0 };
+
+	fdir_hash_params.name = fdir_hash_name;
+	fdir_hash_params.entries = IXGBE_MAX_FDIR_FILTER_NUM;
+	fdir_hash_params.key_len = sizeof(union ixgbe_atr_input);
+	fdir_hash_params.hash_func = rte_hash_crc;
+	fdir_hash_params.hash_func_init_val = 0;
+	fdir_hash_params.socket_id = rte_socket_id();
 
 	TAILQ_INIT(&fdir_info->fdir_list);
 	snprintf(fdir_hash_name, RTE_HASH_NAMESIZE,