Commit 3d93116c authored by Axel Lin's avatar Axel Lin Committed by Linus Torvalds

fs/proc_namespace.c: simplify testing nsp and nsp->mnt_ns

Trivial cleanup to eliminate a goto.
Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c1d867a5
...@@ -234,17 +234,12 @@ static int mounts_open_common(struct inode *inode, struct file *file, ...@@ -234,17 +234,12 @@ static int mounts_open_common(struct inode *inode, struct file *file,
rcu_read_lock(); rcu_read_lock();
nsp = task_nsproxy(task); nsp = task_nsproxy(task);
if (!nsp) { if (!nsp || !nsp->mnt_ns) {
rcu_read_unlock(); rcu_read_unlock();
put_task_struct(task); put_task_struct(task);
goto err; goto err;
} }
ns = nsp->mnt_ns; ns = nsp->mnt_ns;
if (!ns) {
rcu_read_unlock();
put_task_struct(task);
goto err;
}
get_mnt_ns(ns); get_mnt_ns(ns);
rcu_read_unlock(); rcu_read_unlock();
task_lock(task); task_lock(task);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment