* [PATCH] unshare: remove dead code
@ 2012-10-25 14:25 Alan Cox
0 siblings, 0 replies; only message in thread
From: Alan Cox @ 2012-10-25 14:25 UTC (permalink / raw)
To: linux-kernel, akpm
From: Alan Cox <alan@linux.intel.com>
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>
---
kernel/fork.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/kernel/fork.c b/kernel/fork.c
index acc4cb6..60854b2 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1792,10 +1792,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);
@@ -1819,9 +1817,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);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-10-25 14:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-25 14:25 [PATCH] unshare: remove dead code Alan Cox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome