Skip to content

Commit

Permalink
[PATCH] copy_process: error path cleanup
Browse files Browse the repository at this point in the history
This patch moves 'fork_out:' under 'bad_fork_free:', and removes now
unneeded 'if (retval)' check.

Signed-off-by: Oleg Nesterov <[email protected]>
Cc: Ingo Molnar <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Jan 9, 2006
1 parent ddc0f84 commit fe7d37d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions kernel/fork.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -1191,7 +1186,8 @@ static task_t *copy_process(unsigned long clone_flags,
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)
Expand Down

0 comments on commit fe7d37d

Please sign in to comment.