summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatoly Burakov <anatoly.burakov@intel.com>2018-11-05 17:26:56 +0000
committerThomas Monjalon <thomas@monjalon.net>2018-11-06 01:13:58 +0100
commit1ccfeb7df780d7d74605ac2e16cab8aef163481d (patch)
tree9a5b8623e1cf70b883db146a512634c0522f9293
parent7415ad0cdc20b732846d9ae3dabed343781499e3 (diff)
downloaddpdk-1ccfeb7df780d7d74605ac2e16cab8aef163481d.zip
dpdk-1ccfeb7df780d7d74605ac2e16cab8aef163481d.tar.gz
dpdk-1ccfeb7df780d7d74605ac2e16cab8aef163481d.tar.xz
malloc: fix invalid argument handling
When adding memory to an external heap, do not go to unlock failure handler because the memory hotplug lock hasn't been taken out yet. Fixes: 7d75c31014f7 ("malloc: allow adding memory to named heaps") Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
-rw-r--r--lib/librte_eal/common/rte_malloc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/librte_eal/common/rte_malloc.c b/lib/librte_eal/common/rte_malloc.c
index 9e61dc4..0da5ad5 100644
--- a/lib/librte_eal/common/rte_malloc.c
+++ b/lib/librte_eal/common/rte_malloc.c
@@ -349,8 +349,7 @@ rte_malloc_heap_memory_add(const char *heap_name, void *va_addr, size_t len,
strnlen(heap_name, RTE_HEAP_NAME_MAX_LEN) ==
RTE_HEAP_NAME_MAX_LEN) {
rte_errno = EINVAL;
- ret = -1;
- goto unlock;
+ return -1;
}
rte_rwlock_write_lock(&mcfg->memory_hotplug_lock);