diff --git a/fs/proc/base.c b/fs/proc/base.c index 77a57b5799c41cfc2fe84b0bdba00d66b8072eec..ff7a66850602cb4fced3a5250d74bd43d42d4d8b 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -371,9 +371,11 @@ static int mounts_open(struct inode *inode, struct file *file) if (task) { task_lock(task); - ns = task->nsproxy->mnt_ns; - if (ns) - get_mnt_ns(ns); + if (task->nsproxy) { + ns = task->nsproxy->mnt_ns; + if (ns) + get_mnt_ns(ns); + } task_unlock(task); put_task_struct(task); }