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: 7d75c31014 ("malloc: allow adding memory to named heaps")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
This commit is contained in:
Anatoly Burakov 2018-11-05 17:26:56 +00:00 committed by Thomas Monjalon
parent 7415ad0cdc
commit 1ccfeb7df7

View File

@ -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);