From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 3A59F343F for ; Thu, 3 May 2018 10:59:30 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 May 2018 01:59:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,357,1520924400"; d="scan'208";a="47960999" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga003.jf.intel.com with ESMTP; 03 May 2018 01:59:28 -0700 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id w438xSLU000855; Thu, 3 May 2018 09:59:28 +0100 Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id w438xSSR024639; Thu, 3 May 2018 09:59:28 +0100 Received: (from aburakov@localhost) by sivswdev01.ir.intel.com with LOCAL id w438xS86024635; Thu, 3 May 2018 09:59:28 +0100 From: Anatoly Burakov To: dev@dpdk.org Cc: anatoly.burakov@intel.com Date: Thu, 3 May 2018 09:59:28 +0100 Message-Id: X-Mailer: git-send-email 1.7.0.7 Subject: [dpdk-dev] [PATCH] memzone: fix race condition on alloc failure X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 May 2018 08:59:31 -0000 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") Cc: anatoly.burakov@intel.com Signed-off-by: Anatoly Burakov --- 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 bce3321..28f39e2 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.7.4