summaryrefslogtreecommitdiffstats
path: root/fs/proc_namespace.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2014-01-23 15:55:44 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-23 16:37:02 -0800
commit3d93116cef306bd516a7645e7b4895d1d0ceec2b (patch)
tree974f69bf3cd19acc32c0c58d4afade88d9913798 /fs/proc_namespace.c
parentc1d867a54d426b45da017fbe8e585f8a3064ce8d (diff)
downloadlinux-stable-3d93116cef306bd516a7645e7b4895d1d0ceec2b.tar.gz
linux-stable-3d93116cef306bd516a7645e7b4895d1d0ceec2b.tar.bz2
linux-stable-3d93116cef306bd516a7645e7b4895d1d0ceec2b.zip
fs/proc_namespace.c: simplify testing nsp and nsp->mnt_ns
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>
Diffstat (limited to 'fs/proc_namespace.c')
-rw-r--r--fs/proc_namespace.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/fs/proc_namespace.c b/fs/proc_namespace.c
index 439406e081af..7be26f03a3f5 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);