summaryrefslogtreecommitdiff
path: root/kernel/fork.c
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2013-02-28 05:03:23 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-28 07:10:12 +0400
commit6f977e6b2f75fdaccfd9be82bbf72fe5c60e8807 (patch)
tree983e4c0c901c7cc9364e109676597347b7c4ec65 /kernel/fork.c
parent5e62adef9e1d3e8e26dfd6c95be484b955ad2927 (diff)
downloadlinux-6f977e6b2f75fdaccfd9be82bbf72fe5c60e8807.tar.xz
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>
Diffstat (limited to 'kernel/fork.c')
-rw-r--r--kernel/fork.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index 8f62b2a0f120..8d932b1c9056 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -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);
@@ -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);