fs/proc_namespace.c: simplify testing nsp and nsp->mnt_ns
authorAxel Lin <axel.lin@ingics.com>
Thu, 23 Jan 2014 23:55:44 +0000 (15:55 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 24 Jan 2014 00:37:02 +0000 (16:37 -0800)
Trivial cleanup to eliminate a goto.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/proc_namespace.c

index 439406e081af903a298f6305d9e7c1d744b58813..7be26f03a3f5813ed501bea520e79041af4466f7 100644 (file)
@@ -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);