[PATCH] fix copy_process() error check

From: Akinobu Mita
Date: Wed Nov 22 2006 - 13:43:06 EST


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

Signed-off-by: Akinobu Mita <akinobu.mita@xxxxxxxxx>

---
kernel/fork.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

Index: work-fault-inject/kernel/fork.c
===================================================================
--- work-fault-inject.orig/kernel/fork.c
+++ work-fault-inject/kernel/fork.c
@@ -1318,9 +1318,8 @@ struct task_struct * __devinit fork_idle
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;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/