[PATCH] fix copy_process() error check
Changes
1 files changed · +2 −3
| File | Status | Add | Del | Content |
|---|---|---|---|---|
| kernel/fork.c | modified | +2 | −3 | View file |
kernel/fork.c
View filediff --git a/kernel/fork.c b/kernel/fork.c
index 3da978e..8cdd3e7 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1315,9 +1315,8 @@ struct task_struct * __devinit fork_idle(int cpu)
struct pt_regs regs;
task = copy_process(CLONE_VM, 0, idle_regs(®s), 0, NULL, NULL, 0);
- if (!task)
- return ERR_PTR(-ENOMEM);
- init_idle(task, cpu);
+ if (!IS_ERR(task))
+ init_idle(task, cpu);
return task;
}