Index: uspace/srv/devman/devman.c
===================================================================
--- uspace/srv/devman/devman.c	(revision 703d19c8d62d968e9d876fba84d87563a7a18da4)
+++ uspace/srv/devman/devman.c	(revision 2edcb63b48c6f5a75d9ee64650edb25a41140cea)
@@ -540,4 +540,10 @@
 
 		/*
+		 * We remove the device from the list to allow safe adding
+		 * of new devices (no one will touch our item this way).
+		 */
+		list_remove(link);
+
+		/*
 		 * Unlock to avoid deadlock when adding device
 		 * handled by itself.
@@ -552,4 +558,11 @@
 		 */
 		fibril_mutex_lock(&driver->driver_mutex);
+
+		/*
+		 * Insert the device back.
+		 * The order is not relevant here so no harm is done
+		 * (actually, the order would be preserved in most cases).
+		 */
+		list_append(link, &driver->devices);
 
 		/*
@@ -1133,6 +1146,8 @@
 	while (link != &class_list->classes) {
 		cl = list_get_instance(link, dev_class_t, link);
-		if (str_cmp(cl->name, class_name) == 0)
+		if (str_cmp(cl->name, class_name) == 0) {
 			return cl;
+		}
+		link = link->next;
 	}
 	
