net/i40e: fix out of scope variable

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

Coverity issue: 365293
Fixes: ef4c16fd9148 ("net/i40e: refactor RSS flow")

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
This commit is contained in:
Alvin Zhang 2021-01-15 16:34:11 +08:00 committed by Ferruh Yigit
parent a8f630fa06
commit 52a6478257

View File

@ -903,10 +903,12 @@ i40e_hash_parse_key(const struct rte_flow_action_rss *rss_act,
PMD_DRV_LOG(WARNING,
"RSS key length invalid, must be %u bytes, now set key to default",
(uint32_t)sizeof(rss_conf->key));
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);
}