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 multiwriter lock memory allocation
[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
375e7d2
..
f8669a1
100644
(file)
--- a/
lib/librte_hash/rte_cuckoo_hash.c
+++ b/
lib/librte_hash/rte_cuckoo_hash.c
@@
-280,7
+280,10
@@
rte_hash_create(const struct rte_hash_parameters *params)
h->add_key = ADD_KEY_MULTIWRITER;
h->multiwriter_lock = rte_malloc(NULL,
sizeof(rte_spinlock_t),
- LCORE_CACHE_SIZE);
+ RTE_CACHE_LINE_SIZE);
+ if (h->multiwriter_lock == NULL)
+ goto err_unlock;
+
rte_spinlock_init(h->multiwriter_lock);
}
} else