From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: linux-kernel@vger.kernel.org, akpm@linux-foundation.org
Subject: [PATCH] unshare: remove dead code
Date: Thu, 25 Oct 2012 15:25:54 +0100 [thread overview]
Message-ID: <20121025142539.16724.76390.stgit@localhost.localdomain> (raw)
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);
reply other threads:[~2012-10-25 14:24 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121025142539.16724.76390.stgit@localhost.localdomain \
--to=alan@lxorguk.ukuu.org.uk \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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