From 3983953e9eebe517d4679881642e898d4c47023e Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Thu, 29 Nov 2012 14:18:55 +1100 Subject: [PATCH] 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 Signed-off-by: Andrew Morton --- kernel/fork.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/kernel/fork.c b/kernel/fork.c index f907846de161..58add5c805f2 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -1842,10 +1842,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); @@ -1875,9 +1873,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); -- 2.39.5