Index: kernel/generic/src/adt/hash_table.c
===================================================================
--- kernel/generic/src/adt/hash_table.c	(revision 55b77d9e6e4dab7c54e9826ca79d2d6a0ddb6d87)
+++ kernel/generic/src/adt/hash_table.c	(revision 6a0ff7f4cac21a5122279a5eab3cc09ad2902207)
@@ -147,7 +147,8 @@
 	ASSERT(keys <= h->max_keys);
 	
+	
 	if (keys == h->max_keys) {
 		link_t *cur;
-	
+		
 		/*
 		 * All keys are known, hash_table_find() can be used to find the entry.
@@ -168,5 +169,7 @@
 	 */
 	for (chain = 0; chain < h->entries; chain++) {
-		list_foreach(h->entry[chain], cur) {
+		link_t *cur;
+		for (cur = h->entry[chain].head.next; cur != &h->entry[chain].head;
+		    cur = cur->next) {
 			if (h->op->compare(key, keys, cur)) {
 				link_t *hlp;
Index: kernel/generic/src/adt/list.c
===================================================================
--- kernel/generic/src/adt/list.c	(revision 55b77d9e6e4dab7c54e9826ca79d2d6a0ddb6d87)
+++ kernel/generic/src/adt/list.c	(revision 6a0ff7f4cac21a5122279a5eab3cc09ad2902207)
@@ -90,4 +90,22 @@
 }
 
+/** Count list items
+ *
+ * Return the number of items in the list.
+ *
+ * @param list		List to count.
+ * @return		Number of items in the list.
+ */
+unsigned int list_count(const list_t *list)
+{
+	unsigned int count = 0;
+	
+	list_foreach(*list, link) {
+		count++;
+	}
+	
+	return count;
+}
+
 /** @}
  */
