Skip to contentSkip to conversation

fix copy_process() error check

PATCH New Akinobu Mita 1 participant 1 message Nov 22, 2006

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix copy_process() error check

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

---
 kernel/fork.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
kernel/fork.c +2 -3
Index: 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;
 }