Index: uspace/lib/c/generic/devman.c
===================================================================
--- uspace/lib/c/generic/devman.c	(revision 8b5c8ae540254d0b8de85653e594938d5ada9217)
+++ uspace/lib/c/generic/devman.c	(revision 3c106e8814a50268257db9a33c79a75e51e871ec)
@@ -42,4 +42,5 @@
 #include <devman.h>
 #include <async.h>
+#include <fibril_synch.h>
 #include <errno.h>
 #include <malloc.h>
@@ -50,10 +51,15 @@
 static int devman_phone_client = -1;
 
+static FIBRIL_MUTEX_INITIALIZE(devman_phone_mutex);
+
 int devman_get_phone(devman_interface_t iface, unsigned int flags)
 {
 	switch (iface) {
 	case DEVMAN_DRIVER:
-		if (devman_phone_driver >= 0)
+		fibril_mutex_lock(&devman_phone_mutex);
+		if (devman_phone_driver >= 0) {
+			fibril_mutex_unlock(&devman_phone_mutex);
 			return devman_phone_driver;
+		}
 		
 		if (flags & IPC_FLAG_BLOCKING)
@@ -64,8 +70,12 @@
 			    SERVICE_DEVMAN, DEVMAN_DRIVER, 0);
 		
+		fibril_mutex_unlock(&devman_phone_mutex);
 		return devman_phone_driver;
 	case DEVMAN_CLIENT:
-		if (devman_phone_client >= 0)
+		fibril_mutex_lock(&devman_phone_mutex);
+		if (devman_phone_client >= 0) {
+			fibril_mutex_unlock(&devman_phone_mutex);
 			return devman_phone_client;
+		}
 		
 		if (flags & IPC_FLAG_BLOCKING)
@@ -75,5 +85,7 @@
 			devman_phone_client = async_connect_me_to(PHONE_NS,
 			    SERVICE_DEVMAN, DEVMAN_CLIENT, 0);
-		
+			fibril_mutex_unlock(&devman_phone_mutex);
+		
+		fibril_mutex_unlock(&devman_phone_mutex);
 		return devman_phone_client;
 	default:
