Index: uspace/lib/libblock/libblock.c
===================================================================
--- uspace/lib/libblock/libblock.c	(revision 4f690cd2c7a0267072f5686e5a0d2fff1f3be7b7)
+++ uspace/lib/libblock/libblock.c	(revision 7a56b1ed5365c3945bf6edad3933a0b1ae29db25)
@@ -383,5 +383,9 @@
 			unsigned long temp_key;
 recycle:
-			assert(!list_empty(&cache->free_head));
+			if (list_empty(&cache->free_head)) {
+				fibril_mutex_unlock(&cache->lock);
+				rc = ENOMEM;
+				goto out;
+			}
 			l = cache->free_head.next;
 			b = list_get_instance(l, block_t, free_link);
@@ -468,4 +472,5 @@
 		fibril_mutex_unlock(&b->lock);
 	}
+out:
 	if ((rc != EOK) && b) {
 		assert(b->toxic);
