]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
fork: unshare: remove dead code
authorAlan Cox <alan@linux.intel.com>
Fri, 9 Nov 2012 03:05:04 +0000 (14:05 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 14 Nov 2012 04:55:21 +0000 (15:55 +1100)
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>
kernel/fork.c

index 6e32287883dc0986cc52a24088e3d1ccd9743385..58088f9034a934b8085a7c6c8ce6da3fadd97e3d 100644 (file)
@@ -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);