linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs: proc_namespace: simplify testing nsp and nsp->mnt_ns
@ 2013-11-27  3:35 Axel Lin
  0 siblings, 0 replies; only message in thread
From: Axel Lin @ 2013-11-27  3:35 UTC (permalink / raw)
  To: Al Viro, Andrew Morton; +Cc: linux-fsdevel

Trivial cleanup to eliminate a goto.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 fs/proc_namespace.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/fs/proc_namespace.c b/fs/proc_namespace.c
index 439406e..7be26f0 100644
--- a/fs/proc_namespace.c
+++ b/fs/proc_namespace.c
@@ -234,17 +234,12 @@ static int mounts_open_common(struct inode *inode, struct file *file,
 
 	rcu_read_lock();
 	nsp = task_nsproxy(task);
-	if (!nsp) {
+	if (!nsp || !nsp->mnt_ns) {
 		rcu_read_unlock();
 		put_task_struct(task);
 		goto err;
 	}
 	ns = nsp->mnt_ns;
-	if (!ns) {
-		rcu_read_unlock();
-		put_task_struct(task);
-		goto err;
-	}
 	get_mnt_ns(ns);
 	rcu_read_unlock();
 	task_lock(task);
-- 
1.8.1.2




^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-11-27  3:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-27  3:35 [PATCH] fs: proc_namespace: simplify testing nsp and nsp->mnt_ns Axel Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).