]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
fork: unshare: remove dead code
authorAlan Cox <alan@linux.intel.com>
Thu, 7 Feb 2013 01:27:57 +0000 (12:27 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 18 Feb 2013 05:47:23 +0000 (16:47 +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 433c9c536c48fbe2d882499cb782559e55546aab..35fb37d69223a5ac9e6adec74afd10e86a675cf4 100644 (file)
@@ -1857,10 +1857,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);
 
@@ -1890,9 +1888,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);