Index: generic/src/ipc/irq.c
===================================================================
--- generic/src/ipc/irq.c	(revision bdc5c516b811c2d1871bfaaf83a3c1fa14c86fc4)
+++ generic/src/ipc/irq.c	(revision 4c89b095bec1df9ec64df69761ec941fb73fc8e3)
@@ -48,4 +48,5 @@
 #include <ipc/irq.h>
 #include <atomic.h>
+#include <syscall/copy.h>
 
 typedef struct {
@@ -121,7 +122,12 @@
 	irq_code_t *code;
 	irq_cmd_t *ucmds;
+	int rc;
 
 	code = malloc(sizeof(*code), 0);
-	copy_from_uspace(code, ucode, sizeof(*code));
+	rc = copy_from_uspace(code, ucode, sizeof(*code));
+	if (rc != 0) {
+		free(code);
+		return NULL;
+	}
 	
 	if (code->cmdcount > IRQ_MAX_PROG_SIZE) {
@@ -131,5 +137,10 @@
 	ucmds = code->cmds;
 	code->cmds = malloc(sizeof(code->cmds[0]) * (code->cmdcount), 0);
-	copy_from_uspace(code->cmds, ucmds, sizeof(code->cmds[0]) * (code->cmdcount));
+	rc = copy_from_uspace(code->cmds, ucmds, sizeof(code->cmds[0]) * (code->cmdcount));
+	if (rc != 0) {
+		free(code->cmds);
+		free(code);
+		return NULL;
+	}
 
 	return code;
Index: generic/src/ipc/sysipc.c
===================================================================
--- generic/src/ipc/sysipc.c	(revision bdc5c516b811c2d1871bfaaf83a3c1fa14c86fc4)
+++ generic/src/ipc/sysipc.c	(revision 4c89b095bec1df9ec64df69761ec941fb73fc8e3)
@@ -29,7 +29,6 @@
 #include <arch.h>
 #include <proc/task.h>
-
+#include <proc/thread.h>
 #include <errno.h>
-#include <mm/page.h>
 #include <memstr.h>
 #include <debug.h>
@@ -39,8 +38,6 @@
 #include <ipc/ipcrsc.h>
 #include <arch/interrupt.h>
-
 #include <print.h>
-#include <arch.h>
-#include <proc/thread.h>
+#include <syscall/copy.h>
 
 #define GET_CHECK_PHONE(phone,phoneid,err) { \
@@ -229,7 +226,10 @@
 	phone_t *phone;
 	int res;
+	int rc;
 
 	ipc_call_static_init(&call);
-	copy_from_uspace(&call.data.args, &question->args, sizeof(call.data.args));
+	rc = copy_from_uspace(&call.data.args, &question->args, sizeof(call.data.args));
+	if (rc != 0)
+		return (__native) rc;
 
 	GET_CHECK_PHONE(phone, phoneid, return ENOENT);
@@ -241,5 +241,7 @@
 		IPC_SET_RETVAL(call.data, res);
 
-	STRUCT_TO_USPACE(&reply->args, &call.data.args);
+	rc = STRUCT_TO_USPACE(&reply->args, &call.data.args);
+	if (rc != 0)
+		return rc;
 
 	return 0;
@@ -298,4 +300,5 @@
 	phone_t *phone;
 	int res;
+	int rc;
 
 	if (check_call_limit())
@@ -305,5 +308,7 @@
 
 	call = ipc_call_alloc(0);
-	copy_from_uspace(&call->data.args, &data->args, sizeof(call->data.args));
+	rc = copy_from_uspace(&call->data.args, &data->args, sizeof(call->data.args));
+	if (rc != 0)
+		return (__native) rc;
 	if (!(res=request_preprocess(call)))
 		ipc_call(phone, call);
@@ -394,4 +399,5 @@
 	ipc_data_t saved_data;
 	int saveddata = 0;
+	int rc;
 
 	call = get_call(callid);
@@ -403,6 +409,8 @@
 		saveddata = 1;
 	}
-	copy_from_uspace(&call->data.args, &data->args, 
+	rc = copy_from_uspace(&call->data.args, &data->args, 
 			 sizeof(call->data.args));
+	if (rc != 0)
+		return rc;
 
 	answer_preprocess(call, saveddata ? &saved_data : NULL);
