git.droids-corp.org
/
dpdk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a8f630f
)
net/i40e: fix out of scope variable
author
Alvin Zhang
<alvinx.zhang@intel.com>
Fri, 15 Jan 2021 08:34:11 +0000
(16:34 +0800)
committer
Ferruh Yigit
<ferruh.yigit@intel.com>
Tue, 19 Jan 2021 12:49:41 +0000
(13:49 +0100)
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>
drivers/net/i40e/i40e_hash.c
patch
|
blob
|
history
diff --git
a/drivers/net/i40e/i40e_hash.c
b/drivers/net/i40e/i40e_hash.c
index
ae861ab
..
9271797
100644
(file)
--- a/
drivers/net/i40e/i40e_hash.c
+++ b/
drivers/net/i40e/i40e_hash.c
@@
-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);
}