From 3ff39e25e62afc9ca12c9e351ca1f19eef9cb509 Mon Sep 17 00:00:00 2001 From: Anatoly Burakov Date: Thu, 3 May 2018 09:59:28 +0100 Subject: [PATCH] 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 Acked-by: Konstantin Ananyev --- lib/librte_eal/common/eal_common_memzone.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_eal/common/eal_common_memzone.c b/lib/librte_eal/common/eal_common_memzone.c index bce3321090..28f39e227b 100644 --- a/lib/librte_eal/common/eal_common_memzone.c +++ b/lib/librte_eal/common/eal_common_memzone.c @@ -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; } -- 2.20.1