pool: kdbus_pool_slice_alloc() release the pool lock on errors
authorDjalal Harouni <tixxdz@opendz.org>
Mon, 6 Oct 2014 15:44:43 +0000 (16:44 +0100)
committerDaniel Mack <daniel@zonque.org>
Mon, 6 Oct 2014 15:46:06 +0000 (17:46 +0200)
Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
domain.h
pool.c

index 9b790532186348ed52fa6ea684d55c0dac111929..542d2c8505706fbaf7f974d8ed40438e1fb60538 100644 (file)
--- a/domain.h
+++ b/domain.h
@@ -73,7 +73,7 @@ struct kdbus_domain {
  * @kref:              Reference counter
  * @domain:            Domain of the user
  * @hentry:            Entry in domain user map
- * @idr:               Smalles possible index number of all users
+ * @idr:               Smallest possible index number of all users
  * @uid:               UID of the user
  * @buses:             Number of buses the user has created
  * @connections:       Number of connections the user has created
diff --git a/pool.c b/pool.c
index 009125ec57e4df03d8803438a1546cf23c0d4d58..ef181d7c043b566cf5a464ec5be84a83f3b025d3 100644 (file)
--- a/pool.c
+++ b/pool.c
@@ -252,7 +252,10 @@ int kdbus_pool_slice_alloc(struct kdbus_pool *pool,
        mutex_unlock(&pool->lock);
 
        *slice = s;
+       return 0;
+
 exit_unlock:
+       mutex_unlock(&pool->lock);
        return ret;
 }