DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Zhang,Alvin" <alvinx.zhang@intel.com>
To: qi.z.zhang@intel.com
Cc: dev@dpdk.org, Alvin Zhang <alvinx.zhang@intel.com>
Subject: [dpdk-dev] [PATCH] net/i40e: fix out-of-scope variable
Date: Thu, 14 Jan 2021 14:52:48 +0800
Message-ID: <20210114065248.17160-1-alvinx.zhang@intel.com> (raw)

From: Alvin Zhang <alvinx.zhang@intel.com>

Using "key", which points to an out-of-scope variable "rss_key_default".

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
 drivers/net/i40e/i40e_hash.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/i40e/i40e_hash.c b/drivers/net/i40e/i40e_hash.c
index e07f806..83a9af5 100644
--- a/drivers/net/i40e/i40e_hash.c
+++ b/drivers/net/i40e/i40e_hash.c
@@ -901,10 +901,12 @@ struct i40e_hash_match_pattern {
 				    "RSS key length invalid, must be %u bytes, now set key to default",
-		key = (const uint8_t *)rss_key_default;
+		memcpy(rss_conf->key, rss_key_default, sizeof(rss_conf->key));
+	} else {
+		memcpy(rss_conf->key, key, sizeof(rss_conf->key));
-	memcpy(rss_conf->key, key, sizeof(rss_conf->key));
 	rss_conf->conf.key = rss_conf->key;
 	rss_conf->conf.key_len = sizeof(rss_conf->key);

             reply	other threads:[~2021-01-14  6:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-14  6:52 Zhang,Alvin [this message]
2021-01-15  8:34 ` [dpdk-dev] [PATCH v2] " Zhang,Alvin
2021-01-18  8:27   ` Xing, Beilei
2021-01-19  3:47     ` Zhang, Qi Z

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:

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

  git send-email \
    --in-reply-to=20210114065248.17160-1-alvinx.zhang@intel.com \
    --to=alvinx.zhang@intel.com \
    --cc=dev@dpdk.org \
    --cc=qi.z.zhang@intel.com \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git