summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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,
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);