DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/ixgbe: fix possible uninitialized variable
@ 2018-12-22 12:40 Haiyang Tan
  0 siblings, 0 replies; only message in thread
From: Haiyang Tan @ 2018-12-22 12:40 UTC (permalink / raw)
  To: Wenzhuo Lu, Konstantin Ananyev; +Cc: dev, Haiyang Tan

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(-)

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,
-- 
2.14.1

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-12-22 12:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-22 12:40 [dpdk-dev] [PATCH] net/ixgbe: fix possible uninitialized variable Haiyang Tan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).