[PATCH] copy_process: error path cleanup

From: Oleg Nesterov
Date: Mon Dec 12 2005 - 11:58:09 EST


This patch moves 'fork_out:' under 'bad_fork_free:',
and removes now unneeded 'if (retval)' check.

Signed-off-by: Oleg Nesterov <oleg@xxxxxxxxxx>

--- 2.6.15-rc5/kernel/fork.c~ 2005-12-06 23:33:16.000000000 +0300
+++ 2.6.15-rc5/kernel/fork.c 2005-12-12 22:55:12.000000000 +0300
@@ -1141,11 +1141,7 @@ static task_t *copy_process(unsigned lon
write_unlock_irq(&tasklist_lock);
proc_fork_connector(p);
cpuset_fork(p);
- retval = 0;

-fork_out:
- if (retval)
- return ERR_PTR(retval);
return p;

bad_fork_cleanup_namespace:
@@ -1184,7 +1180,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)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/