git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
hash: fix allocation of an existing object
[dpdk.git]
/
lib
/
librte_hash
/
rte_cuckoo_hash.c
diff --git
a/lib/librte_hash/rte_cuckoo_hash.c
b/lib/librte_hash/rte_cuckoo_hash.c
index
04e95b7
..
b00cc12
100644
(file)
--- a/
lib/librte_hash/rte_cuckoo_hash.c
+++ b/
lib/librte_hash/rte_cuckoo_hash.c
@@
-299,8
+299,10
@@
rte_hash_create(const struct rte_hash_parameters *params)
/* Guarantee there's no existing */
h = rte_hash_find_existing(params->name);
- if (h != NULL)
- return h;
+ if (h != NULL) {
+ rte_errno = EEXIST;
+ return NULL;
+ }
te = rte_zmalloc("HASH_TAILQ_ENTRY", sizeof(*te), 0);
if (te == NULL) {