DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] malloc: fix invalid argument handling
@ 2018-11-05 17:26 Anatoly Burakov
  2018-11-05 22:21 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Anatoly Burakov @ 2018-11-05 17:26 UTC (permalink / raw)
  To: dev; +Cc: janos.kobor, marton.a.toth, laszlo.madarassy

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

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 lib/librte_eal/common/rte_malloc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/librte_eal/common/rte_malloc.c b/lib/librte_eal/common/rte_malloc.c
index 9e61dc41b..0da5ad5e8 100644
--- a/lib/librte_eal/common/rte_malloc.c
+++ b/lib/librte_eal/common/rte_malloc.c
@@ -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);
 
-- 
2.17.1

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

end of thread, other threads:[~2018-11-05 22:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-05 17:26 [dpdk-dev] [PATCH] malloc: fix invalid argument handling Anatoly Burakov
2018-11-05 22:21 ` 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).