From fab6944206bf44e2260f20a9d5f1e785f933e705 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Sat, 18 Aug 2018 11:39:03 +0530 Subject: coverity: libglusterfs issues CID: 1391415, 1274122, 1274201, 1382408, 1382437, 1389436 1288798, 1288106, 1288110 updates: bz#789278 Change-Id: I48c7a50f22f5f4580310040c66463d9f7dd26204 Signed-off-by: Amar Tumballi --- libglusterfs/src/mem-pool.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libglusterfs/src/mem-pool.c') diff --git a/libglusterfs/src/mem-pool.c b/libglusterfs/src/mem-pool.c index 252bae5d7e3..4b140296b4f 100644 --- a/libglusterfs/src/mem-pool.c +++ b/libglusterfs/src/mem-pool.c @@ -825,9 +825,9 @@ mem_get (struct mem_pool *mem_pool) (void) pthread_spin_lock (&pool_list->lock); pt_pool = &pool_list->pools[mem_pool->pool->power_of_two-POOL_SMALLEST]; retval = mem_get_from_pool (pt_pool); - (void) pthread_spin_unlock (&pool_list->lock); if (!retval) { + (void) pthread_spin_unlock (&pool_list->lock); return NULL; } @@ -835,6 +835,7 @@ mem_get (struct mem_pool *mem_pool) retval->pool = mem_pool; retval->pool_list = pool_list; retval->power_of_two = mem_pool->pool->power_of_two; + (void) pthread_spin_unlock (&pool_list->lock); GF_ATOMIC_INC (mem_pool->active); -- cgit