libbarrelfish: two_level_alloc: Unlock mutex when we error out early.
authorSimon Gerber <simon.gerber@inf.ethz.ch>
Mon, 7 Nov 2016 09:11:45 +0000 (10:11 +0100)
committerSimon Gerber <simon.gerber@inf.ethz.ch>
Mon, 7 Nov 2016 09:13:17 +0000 (10:13 +0100)
Reported-by: Georg Kilzer <gkilzer@student.ethz.ch
Signed-off-by: Georg Kilzer <gkilzer@student.ethz.ch
Signed-off-by: Simon Gerber <simon.gerber@inf.ethz.ch>

lib/barrelfish/slot_alloc/twolevel_slot_alloc.c

index 69d8394..efcd206 100644 (file)
@@ -44,6 +44,7 @@ errval_t two_level_alloc(struct slot_allocator *ca, struct capref *ret)
         walk = walk->next;
     }
     if (err_is_fail(err)) {
+        thread_mutex_unlock(&ca->mutex);
         return err_push(err, LIB_ERR_SINGLE_SLOT_ALLOC);
     }