memzone: fix race condition on alloc failure

Deallocation used the wrong function, which could have resulted in
race conditions because the function does not use locks internally.

Fixes: 1403f87d4fb8 ("malloc: enable memory hotplug support")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
This commit is contained in:
Anatoly Burakov 2018-05-03 09:59:28 +01:00 committed by Thomas Monjalon
parent 68c3603867
commit 3ff39e25e6

View File

@ -205,7 +205,7 @@ memzone_reserve_aligned_thread_unsafe(const char *name, size_t len,
if (mz == NULL) {
RTE_LOG(ERR, EAL, "%s(): Cannot find free memzone\n", __func__);
malloc_elem_free(elem);
malloc_heap_free(elem);
rte_errno = ENOSPC;
return NULL;
}