Index: kernel/generic/src/ipc/sysipc.c
===================================================================
--- kernel/generic/src/ipc/sysipc.c	(revision 7d158097c0aa0092b3084c0bcd5e71befdd1194f)
+++ kernel/generic/src/ipc/sysipc.c	(revision 81b430a1d2cded9a53f2d692a1a4ff605a49b13c)
@@ -356,16 +356,17 @@
 		GET_CHECK_PHONE(cloned_phone, IPC_GET_ARG1(call->data),
 		    return ENOENT);
-		if (phone  == cloned_phone)
-			return EEXISTS;
 		if (cloned_phone < phone) {
 			mutex_lock(&cloned_phone->lock);
 			mutex_lock(&phone->lock);
+		} else if (cloned_phone > phone) {
+			mutex_lock(&phone->lock);
+			mutex_lock(&cloned_phone->lock);
 		} else {
 			mutex_lock(&phone->lock);
-			mutex_lock(&cloned_phone->lock);
 		}
 		if ((cloned_phone->state != IPC_PHONE_CONNECTED) ||
 		    phone->state != IPC_PHONE_CONNECTED) {
-			mutex_unlock(&cloned_phone->lock);
+			if (cloned_phone != phone)
+				mutex_unlock(&cloned_phone->lock);
 			mutex_unlock(&phone->lock);
 			return EINVAL;
@@ -379,5 +380,6 @@
 		newphid = phone_alloc(phone->callee->task);
 		if (newphid < 0) {
-			mutex_unlock(&cloned_phone->lock);
+			if (cloned_phone != phone)
+				mutex_unlock(&cloned_phone->lock);
 			mutex_unlock(&phone->lock);
 			return ELIMIT;
@@ -385,5 +387,6 @@
 		ipc_phone_connect(&phone->callee->task->phones[newphid],
 		    cloned_phone->callee);
-		mutex_unlock(&cloned_phone->lock);
+		if (cloned_phone != phone)
+			mutex_unlock(&cloned_phone->lock);
 		mutex_unlock(&phone->lock);
 		/* Set the new phone for the callee. */
