summaryrefslogtreecommitdiffstats
path: root/kernel/fork.c
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2006-11-25 20:09:34 +0100
committerLinus Torvalds <torvalds@woody.osdl.org>2006-11-25 22:28:34 +0100
commit753ca4f312a4b26940e4731b4fa5dbbbbcc77e97 (patch)
treebf0ca9aa882e50b681ec72e43998542472752ef6 /kernel/fork.c
parent[PATCH] sgiioc4: Disable module unload (diff)
downloadlinux-753ca4f312a4b26940e4731b4fa5dbbbbcc77e97.tar.xz
linux-753ca4f312a4b26940e4731b4fa5dbbbbcc77e97.zip
[PATCH] fix copy_process() error check
The return value of copy_process() should be checked by IS_ERR(). Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/fork.c')
-rw-r--r--kernel/fork.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index 3da978eec791..8cdd3e72ba55 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(&regs), 0, NULL, NULL, 0);
- if (!task)
- return ERR_PTR(-ENOMEM);
- init_idle(task, cpu);
+ if (!IS_ERR(task))
+ init_idle(task, cpu);
return task;
}