Index: kernel/generic/src/ipc/ipcrsc.c
===================================================================
--- kernel/generic/src/ipc/ipcrsc.c	(revision 90f20cfd46bca7e15c5e858587268ccf5e1de029)
+++ kernel/generic/src/ipc/ipcrsc.c	(revision 62ca560dd1468a2f5b122d9ee3473a376d048bae)
@@ -166,11 +166,13 @@
  * @param task  Task for which to allocate a new phone.
  *
- * @return  New phone capability handle.
+ * @param[out] out_handle  New phone capability handle.
+ *
  * @return  Negative error code if a new capability cannot be allocated.
  */
-cap_handle_t phone_alloc(task_t *task)
-{
-	cap_handle_t handle = cap_alloc(task);
-	if (handle >= 0) {
+int phone_alloc(task_t *task, cap_handle_t *out_handle)
+{
+	cap_handle_t handle;
+	int rc = cap_alloc(task, &handle);
+	if (rc == EOK) {
 		phone_t *phone = slab_alloc(phone_cache, FRAME_ATOMIC);
 		if (!phone) {
@@ -193,7 +195,8 @@
 		
 		cap_publish(task, handle, kobject);
+
+		*out_handle = handle;
 	}
-	
-	return handle;
+	return rc;
 }
 
Index: kernel/generic/src/ipc/irq.c
===================================================================
--- kernel/generic/src/ipc/irq.c	(revision 90f20cfd46bca7e15c5e858587268ccf5e1de029)
+++ kernel/generic/src/ipc/irq.c	(revision 62ca560dd1468a2f5b122d9ee3473a376d048bae)
@@ -330,9 +330,10 @@
 	 * Allocate and populate the IRQ kernel object.
 	 */
-	cap_handle_t handle = cap_alloc(TASK);
-	if (handle < 0)
-		return handle;
-	
-	int rc = copy_to_uspace(uspace_handle, &handle, sizeof(cap_handle_t));
+	cap_handle_t handle;
+	int rc = cap_alloc(TASK, &handle);
+	if (rc != EOK)
+		return rc;
+	
+	rc = copy_to_uspace(uspace_handle, &handle, sizeof(cap_handle_t));
 	if (rc != EOK) {
 		cap_free(TASK, handle);
Index: kernel/generic/src/ipc/kbox.c
===================================================================
--- kernel/generic/src/ipc/kbox.c	(revision 90f20cfd46bca7e15c5e858587268ccf5e1de029)
+++ kernel/generic/src/ipc/kbox.c	(revision 62ca560dd1468a2f5b122d9ee3473a376d048bae)
@@ -252,8 +252,9 @@
 	
 	/* Allocate a new phone. */
-	cap_handle_t phone_handle = phone_alloc(TASK);
-	if (phone_handle < 0) {
+	cap_handle_t phone_handle;
+	int rc = phone_alloc(TASK, &phone_handle);
+	if (rc != EOK) {
 		mutex_unlock(&task->kb.cleanup_lock);
-		return phone_handle;
+		return rc;
 	}
 	
Index: kernel/generic/src/ipc/ops/conctmeto.c
===================================================================
--- kernel/generic/src/ipc/ops/conctmeto.c	(revision 90f20cfd46bca7e15c5e858587268ccf5e1de029)
+++ kernel/generic/src/ipc/ops/conctmeto.c	(revision 62ca560dd1468a2f5b122d9ee3473a376d048bae)
@@ -42,10 +42,13 @@
 static int request_preprocess(call_t *call, phone_t *phone)
 {
-	cap_handle_t phone_handle = phone_alloc(TASK);
+	cap_handle_t phone_handle;
+	int rc = phone_alloc(TASK, &phone_handle);
 
-	/* Remember the phone capability or the error. */
-	call->priv = phone_handle;
-	if (phone_handle < 0)
-		return phone_handle;
+	/* Remember the phone capability or that an error occured. */
+	call->priv = (rc == EOK) ? phone_handle : -1;
+
+	if (rc != EOK) {
+		return rc;
+	}
 
 	/* Set arg5 for server */
@@ -61,4 +64,9 @@
 {
 	cap_handle_t phone_handle = (cap_handle_t) call->priv;
+
+	if (phone_handle < 0) {
+		return EOK;
+	}
+
 	phone_dealloc(phone_handle);
 	/* Hand over reference from ARG5 to phone->kobject */
Index: kernel/generic/src/ipc/ops/concttome.c
===================================================================
--- kernel/generic/src/ipc/ops/concttome.c	(revision 90f20cfd46bca7e15c5e858587268ccf5e1de029)
+++ kernel/generic/src/ipc/ops/concttome.c	(revision 62ca560dd1468a2f5b122d9ee3473a376d048bae)
@@ -42,9 +42,8 @@
 static int request_process(call_t *call, answerbox_t *box)
 {
-	cap_handle_t phone_handle = phone_alloc(TASK);
-
-	IPC_SET_ARG5(call->data, phone_handle);
-	
-	return EOK;
+	cap_handle_t phone_handle;
+	int rc = phone_alloc(TASK, &phone_handle);
+	IPC_SET_ARG5(call->data, (rc == EOK) ? phone_handle : -1);
+	return 0;
 }
 
Index: kernel/generic/src/ipc/sysipc.c
===================================================================
--- kernel/generic/src/ipc/sysipc.c	(revision 90f20cfd46bca7e15c5e858587268ccf5e1de029)
+++ kernel/generic/src/ipc/sysipc.c	(revision 62ca560dd1468a2f5b122d9ee3473a376d048bae)
@@ -804,8 +804,7 @@
 		goto restart;
 	
-	int rc;
-	cap_handle_t handle = cap_alloc(TASK);
-	if (handle < 0) {
-		rc = handle;
+	cap_handle_t handle;
+	int rc = cap_alloc(TASK, &handle);
+	if (rc != EOK) {
 		goto error;
 	}
