mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] fix copy_process() error check
@ 2006-11-22 18:36 Akinobu Mita
  0 siblings, 0 replies; only message in thread
From: Akinobu Mita @ 2006-11-22 18:36 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andrew Morton

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

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

---
 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;
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-11-22 18:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-22 18:36 [PATCH] fix copy_process() error check Akinobu Mita

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®