[dpdk-dev] malloc: fix not unlocking hotplug on fail to init

Message ID 9d5e4a60da6c550be1d0b695b170279d51ed38e1.1523635100.git.anatoly.burakov@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Anatoly Burakov April 13, 2018, 3:58 p.m. UTC
  We lock the hotplug during init, but do not unlock it if we couldn't
register multiprocess callbacks. Add the missing unlock.

Fixes: 07dcbfe0101f ("malloc: support multiprocess memory hotplug")
Cc: anatoly.burakov@intel.com

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

Comments

Thomas Monjalon April 17, 2018, 10:14 a.m. UTC | #1
13/04/2018 17:58, Anatoly Burakov:
> We lock the hotplug during init, but do not unlock it if we couldn't
> register multiprocess callbacks. Add the missing unlock.
> 
> Fixes: 07dcbfe0101f ("malloc: support multiprocess memory hotplug")
> Cc: anatoly.burakov@intel.com
> 
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>

Applied, thanks
  

Patch

diff --git a/lib/librte_eal/common/malloc_heap.c b/lib/librte_eal/common/malloc_heap.c
index 41c14a8..590e9e3 100644
--- a/lib/librte_eal/common/malloc_heap.c
+++ b/lib/librte_eal/common/malloc_heap.c
@@ -815,6 +815,7 @@  rte_eal_malloc_heap_init(void)
 
 	if (register_mp_requests()) {
 		RTE_LOG(ERR, EAL, "Couldn't register malloc multiprocess actions\n");
+		rte_rwlock_read_unlock(&mcfg->memory_hotplug_lock);
 		return -1;
 	}