fix copy_process() error check
Subsystems (3)
PATCH 1/1 fix copy_process() error check
The return value of copy_process() should be checked by IS_ERR().
Signed-off-by Akinobu Mita <[email protected]>
--- kernel/fork.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
kernel/fork.c +2 -3
@@ -1318,9 +1318,8 @@ struct task_struct * __devinit fork_idlestruct 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; }