summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2014-01-24 00:55:44 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-24 01:37:02 +0100
commit3d93116cef306bd516a7645e7b4895d1d0ceec2b (patch)
tree974f69bf3cd19acc32c0c58d4afade88d9913798
parentfs/proc/proc_devtree.c: remove empty /proc/device-tree when no openfirmware e... (diff)
downloadlinux-3d93116cef306bd516a7645e7b4895d1d0ceec2b.tar.xz
linux-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>
-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);