Skip to content

Commit 6f977e6

Browse files
Alan Coxtorvalds
authored andcommitted
fork: unshare: remove dead code
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 <alan@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 5e62ade commit 6f977e6

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

‎kernel/fork.c‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1861,10 +1861,8 @@ SYSCALL_DEFINE1(unshare, unsigned long, unshare_flags)
18611861
exit_sem(current);
18621862
}
18631863

1864-
if (new_nsproxy) {
1864+
if (new_nsproxy)
18651865
switch_task_namespaces(current, new_nsproxy);
1866-
new_nsproxy = NULL;
1867-
}
18681866

18691867
task_lock(current);
18701868

@@ -1894,9 +1892,6 @@ SYSCALL_DEFINE1(unshare, unsigned long, unshare_flags)
18941892
}
18951893
}
18961894

1897-
if (new_nsproxy)
1898-
put_nsproxy(new_nsproxy);
1899-
19001895
bad_unshare_cleanup_cred:
19011896
if (new_cred)
19021897
put_cred(new_cred);

0 commit comments

Comments
 (0)