diff options
author | Axel Lin <axel.lin@ingics.com> | 2014-01-23 18:55:44 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-23 19:37:02 -0500 |
commit | 3d93116cef306bd516a7645e7b4895d1d0ceec2b (patch) | |
tree | 974f69bf3cd19acc32c0c58d4afade88d9913798 | |
parent | c1d867a54d426b45da017fbe8e585f8a3064ce8d (diff) |
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.c | 7 |
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, | |||
234 | 234 | ||
235 | rcu_read_lock(); | 235 | rcu_read_lock(); |
236 | nsp = task_nsproxy(task); | 236 | nsp = task_nsproxy(task); |
237 | if (!nsp) { | 237 | if (!nsp || !nsp->mnt_ns) { |
238 | rcu_read_unlock(); | 238 | rcu_read_unlock(); |
239 | put_task_struct(task); | 239 | put_task_struct(task); |
240 | goto err; | 240 | goto err; |
241 | } | 241 | } |
242 | ns = nsp->mnt_ns; | 242 | ns = nsp->mnt_ns; |
243 | if (!ns) { | ||
244 | rcu_read_unlock(); | ||
245 | put_task_struct(task); | ||
246 | goto err; | ||
247 | } | ||
248 | get_mnt_ns(ns); | 243 | get_mnt_ns(ns); |
249 | rcu_read_unlock(); | 244 | rcu_read_unlock(); |
250 | task_lock(task); | 245 | task_lock(task); |