DPDK patches and discussions
 help / color / mirror / Atom feed
From: Haiyang Tan <haiyangtan@tencent.com>
To: Wenzhuo Lu <wenzhuo.lu@intel.com>,
	Konstantin Ananyev <konstantin.ananyev@intel.com>
Cc: dev@dpdk.org, Haiyang Tan <haiyangtan@tencent.com>
Subject: [dpdk-dev] [PATCH] net/ixgbe: fix possible uninitialized variable
Date: Sat, 22 Dec 2018 04:40:14 -0800	[thread overview]
Message-ID: <20181222124014.95181-1-haiyangtan@tencent.com> (raw)

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

                 reply	other threads:[~2018-12-22 12:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181222124014.95181-1-haiyangtan@tencent.com \
    --to=haiyangtan@tencent.com \
    --cc=dev@dpdk.org \
    --cc=konstantin.ananyev@intel.com \
    --cc=wenzhuo.lu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).