[PATCH] copy_process: error path cleanup
authorOleg Nesterov <oleg@tv-sign.ru>
Sun, 8 Jan 2006 09:04:02 +0000 (01:04 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 9 Jan 2006 04:14:01 +0000 (20:14 -0800)
This patch moves 'fork_out:' under 'bad_fork_free:', and removes now
unneeded 'if (retval)' check.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
kernel/fork.c

index 4bc0bd8ef1761d07a425994bbdbf857b75f32fc3..72e3252c6763400fea40a4f387a780627d2cbbf7 100644 (file)
@@ -1146,11 +1146,6 @@ static task_t *copy_process(unsigned long clone_flags,
        total_forks++;
        write_unlock_irq(&tasklist_lock);
        proc_fork_connector(p);
-       retval = 0;
-
-fork_out:
-       if (retval)
-               return ERR_PTR(retval);
        return p;
 
 bad_fork_cleanup_namespace:
@@ -1191,7 +1186,8 @@ bad_fork_cleanup_count:
        free_uid(p->user);
 bad_fork_free:
        free_task(p);
-       goto fork_out;
+fork_out:
+       return ERR_PTR(retval);
 }
 
 struct pt_regs * __devinit __attribute__((weak)) idle_regs(struct pt_regs *regs)