DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] memzone: fix race condition on alloc failure
@ 2018-05-03  8:59 Anatoly Burakov
  2018-05-10 14:30 ` Ananyev, Konstantin
  0 siblings, 1 reply; 3+ messages in thread
From: Anatoly Burakov @ 2018-05-03  8:59 UTC (permalink / raw)
  To: dev; +Cc: anatoly.burakov

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 <anatoly.burakov@intel.com>
---
 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] memzone: fix race condition on alloc failure
  2018-05-03  8:59 [dpdk-dev] [PATCH] memzone: fix race condition on alloc failure Anatoly Burakov
@ 2018-05-10 14:30 ` Ananyev, Konstantin
  2018-05-13 23:38   ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Ananyev, Konstantin @ 2018-05-10 14:30 UTC (permalink / raw)
  To: Burakov, Anatoly, dev; +Cc: Burakov, Anatoly



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Anatoly Burakov
> Sent: Thursday, May 3, 2018 9:59 AM
> To: dev@dpdk.org
> Cc: Burakov, Anatoly <anatoly.burakov@intel.com>
> Subject: [dpdk-dev] [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")
> Cc: anatoly.burakov@intel.com
> 
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> ---


Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] memzone: fix race condition on alloc failure
  2018-05-10 14:30 ` Ananyev, Konstantin
@ 2018-05-13 23:38   ` Thomas Monjalon
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2018-05-13 23:38 UTC (permalink / raw)
  To: Burakov, Anatoly; +Cc: dev, Ananyev, Konstantin

> > 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 <anatoly.burakov@intel.com>
> 
> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-13 23:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-03  8:59 [dpdk-dev] [PATCH] memzone: fix race condition on alloc failure Anatoly Burakov
2018-05-10 14:30 ` Ananyev, Konstantin
2018-05-13 23:38   ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).