Skip to content

Commit

Permalink
fork: unshare: remove dead code
Browse files Browse the repository at this point in the history
If new_nsproxy is set we will always call switch_task_namespaces and
then set new_nsproxy back to NULL so the reassignment and fall through
check are redundant

Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Alan Cox authored and torvalds committed Feb 28, 2013
1 parent 5e62ade commit 6f977e6
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions kernel/fork.c
Original file line number Diff line number Diff line change
Expand Up @@ -1861,10 +1861,8 @@ SYSCALL_DEFINE1(unshare, unsigned long, unshare_flags)
exit_sem(current);
}

if (new_nsproxy) {
if (new_nsproxy)
switch_task_namespaces(current, new_nsproxy);
new_nsproxy = NULL;
}

task_lock(current);

Expand Down Expand Up @@ -1894,9 +1892,6 @@ SYSCALL_DEFINE1(unshare, unsigned long, unshare_flags)
}
}

if (new_nsproxy)
put_nsproxy(new_nsproxy);

bad_unshare_cleanup_cred:
if (new_cred)
put_cred(new_cred);
Expand Down

0 comments on commit 6f977e6

Please sign in to comment.