Commit fe7d37d1fbf8ffe78abd72728b24fb0c64f7af55
Committed by
Linus Torvalds
1 parent
ddc0f846aa
Exists in
master
and in
39 other branches
[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: 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>
Showing 1 changed file with 2 additions and 6 deletions Side-by-side Diff
kernel/fork.c
... | ... | @@ -1146,11 +1146,6 @@ |
1146 | 1146 | total_forks++; |
1147 | 1147 | write_unlock_irq(&tasklist_lock); |
1148 | 1148 | proc_fork_connector(p); |
1149 | - retval = 0; | |
1150 | - | |
1151 | -fork_out: | |
1152 | - if (retval) | |
1153 | - return ERR_PTR(retval); | |
1154 | 1149 | return p; |
1155 | 1150 | |
1156 | 1151 | bad_fork_cleanup_namespace: |
... | ... | @@ -1191,7 +1186,8 @@ |
1191 | 1186 | free_uid(p->user); |
1192 | 1187 | bad_fork_free: |
1193 | 1188 | free_task(p); |
1194 | - goto fork_out; | |
1189 | +fork_out: | |
1190 | + return ERR_PTR(retval); | |
1195 | 1191 | } |
1196 | 1192 | |
1197 | 1193 | struct pt_regs * __devinit __attribute__((weak)) idle_regs(struct pt_regs *regs) |