Skip to contentSkip to conversation

fs: proc_namespace: simplify testing nsp and nsp->mnt_ns

PATCH New Axel Lin 1 participant 1 message Nov 27, 2013 VFS

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 fs: proc_namespace: simplify testing nsp and nsp->mnt_ns

Trivial cleanup to eliminate a goto.

---
 fs/proc_namespace.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
fs/proc_namespace.c +1 -6
index 439406e..7be26f0 100644
@@ -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);
Signature · 1 line
1.8.1.2