projects/linux·commit 753ca4f3

[PATCH] fix copy_process() error check

753ca4f3 · Akinobu Mita <[email protected]> · 2006-11-25 11:09:34 -08:00

The return value of copy_process() should be checked by IS_ERR().

Signed-off-by: Akinobu Mita <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Commit
753ca4f312a4b26940e4731b4fa5dbbbbcc77e97
Parents
a1b26c32

Changes

1 files changed · +2 −3

FileStatusAddDelContent
kernel/fork.cmodified+2−3View file

kernel/fork.c

View file
diff --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(&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;
}