From: Alan Cox Date: Fri, 9 Nov 2012 03:05:04 +0000 (+1100) Subject: fork: unshare: remove dead code X-Git-Tag: next-20121112~5^2~48 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b7e4fc7cd14b016b6ef73d0b1b6069fe73e2e3ca;p=karo-tx-linux.git 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 --- diff --git a/kernel/fork.c b/kernel/fork.c index 6e32287883dc..58088f9034a9 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -1835,10 +1835,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); @@ -1862,9 +1860,6 @@ SYSCALL_DEFINE1(unshare, unsigned long, unshare_flags) task_unlock(current); } - if (new_nsproxy) - put_nsproxy(new_nsproxy); - bad_unshare_cleanup_fd: if (new_fd) put_files_struct(new_fd);