Skip to content

Commit

Permalink
fs/proc_namespace.c: simplify testing nsp and nsp->mnt_ns
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
AxelLin authored and torvalds committed Jan 24, 2014
1 parent c1d867a commit 3d93116
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions fs/proc_namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3d93116

Please sign in to comment.