Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1242227

[PATCH 17/44] kdbus: Drop duplicated code from kdbus_pool_slice_alloc()

From Sergei Zviagintsev <sergei@s15v.net>
Newsgroups linux.kernel
Subject [PATCH 17/44] kdbus: Drop duplicated code from kdbus_pool_slice_alloc()
Date 2015-10-08 13:40 +0200
Message-ID <qhhIe-2d4-19@gated-at.bofh.it> (permalink)
References <qhhId-2d4-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Check the value of `ret' instead of keeping separate exit point.

Signed-off-by: Sergei Zviagintsev <sergei@s15v.net>
---
 ipc/kdbus/pool.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/ipc/kdbus/pool.c b/ipc/kdbus/pool.c
index cb692a35755b..75a7366baa34 100644
--- a/ipc/kdbus/pool.c
+++ b/ipc/kdbus/pool.c
@@ -261,13 +261,10 @@ struct kdbus_pool_slice *kdbus_pool_slice_alloc(struct kdbus_pool *pool,
 	s->accounted = accounted;
 	if (accounted)
 		pool->accounted_size += s->size;
-	mutex_unlock(&pool->lock);
-
-	return s;
 
 exit_unlock:
 	mutex_unlock(&pool->lock);
-	return ERR_PTR(ret);
+	return ret < 0 ? ERR_PTR(ret) : s;
 }
 
 static void __kdbus_pool_slice_release(struct kdbus_pool_slice *slice)
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 17/44] kdbus: Drop duplicated code from kdbus_pool_slice_alloc() Sergei Zviagintsev <sergei@s15v.net> - 2015-10-08 13:40 +0200

csiph-web