Index: kernel/generic/src/ipc/ipc.c
===================================================================
--- kernel/generic/src/ipc/ipc.c	(revision 4428d625438c3a087e37dbed0b73e46d912e9d4a)
+++ kernel/generic/src/ipc/ipc.c	(revision b131ef30e1b4cf04992cd0201244896087121df1)
@@ -147,4 +147,5 @@
 	list_initialize(&box->answers);
 	list_initialize(&box->irq_notifs);
+	atomic_set(&box->active_calls, 0);
 	box->task = task;
 }
@@ -350,4 +351,5 @@
 	} else {
 		atomic_inc(&phone->active_calls);
+		atomic_inc(&caller->answerbox.active_calls);
 		kobject_add_ref(phone->kobject);
 		call->sender = caller;
@@ -564,4 +566,5 @@
 		list_remove(&request->ab_link);
 		atomic_dec(&request->caller_phone->active_calls);
+		atomic_dec(&box->active_calls);
 		kobject_put(request->caller_phone->kobject);
 	} else if (!list_empty(&box->calls)) {
@@ -709,4 +712,5 @@
 
 	atomic_dec(&call->caller_phone->active_calls);
+	atomic_dec(&TASK->answerbox.active_calls);
 	kobject_put(call->caller_phone->kobject);
 
@@ -799,9 +803,9 @@
 	/*
 	 * Go through all phones, until they are all free.
-	 * Locking is needed as there may be connection handshakes in progress.
 	 */
 	restart = false;
 	if (caps_apply_to_kobject_type(TASK, KOBJECT_TYPE_PHONE,
-	    phone_cap_wait_cb, &restart)) {
+	    phone_cap_wait_cb, &restart) &&
+	    atomic_get(&TASK->answerbox.active_calls) == 0) {
 		/* Got into cleanup */
 		return;
