summaryrefslogtreecommitdiff
path: root/kernel/user.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--kernel/user.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/user.c b/kernel/user.c
index 592b35b..3c686a0 100644
--- a/kernel/user.c
+++ b/kernel/user.c
@@ -98,6 +98,10 @@ static int user_setup_stack(struct pcb *pcb)
int user_load(struct pcb *pcb, struct disk *disk)
{
+ // check inputs
+ if (pcb == NULL || disk == NULL)
+ return 1;
+
pcb->regs = NULL;
// allocate memory context