提交 fe7d37d1 编写于 作者: O Oleg Nesterov 提交者: Linus Torvalds

[PATCH] copy_process: error path cleanup

This patch moves 'fork_out:' under 'bad_fork_free:', and removes now
unneeded 'if (retval)' check.
Signed-off-by: NOleg Nesterov <oleg@tv-sign.ru>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 ddc0f846
...@@ -1146,11 +1146,6 @@ static task_t *copy_process(unsigned long clone_flags, ...@@ -1146,11 +1146,6 @@ static task_t *copy_process(unsigned long clone_flags,
total_forks++; total_forks++;
write_unlock_irq(&tasklist_lock); write_unlock_irq(&tasklist_lock);
proc_fork_connector(p); proc_fork_connector(p);
retval = 0;
fork_out:
if (retval)
return ERR_PTR(retval);
return p; return p;
bad_fork_cleanup_namespace: bad_fork_cleanup_namespace:
...@@ -1191,7 +1186,8 @@ static task_t *copy_process(unsigned long clone_flags, ...@@ -1191,7 +1186,8 @@ static task_t *copy_process(unsigned long clone_flags,
free_uid(p->user); free_uid(p->user);
bad_fork_free: bad_fork_free:
free_task(p); free_task(p);
goto fork_out; fork_out:
return ERR_PTR(retval);
} }
struct pt_regs * __devinit __attribute__((weak)) idle_regs(struct pt_regs *regs) struct pt_regs * __devinit __attribute__((weak)) idle_regs(struct pt_regs *regs)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册