aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namespace.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/namespace.c')
-rw-r--r--fs/namespace.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index 900812f..8b34a97 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -1477,8 +1477,14 @@ struct vfsmount *collect_mounts(struct path *path)
{
struct vfsmount *tree;
down_write(&namespace_sem);
- tree = copy_tree(path->mnt, path->dentry, CL_COPY_ALL | CL_PRIVATE);
+ if (!check_mnt(path->mnt))
+ tree = ERR_PTR(-EINVAL);
+ else
+ tree = copy_tree(path->mnt, path->dentry,
+ CL_COPY_ALL | CL_PRIVATE);
up_write(&namespace_sem);
+ if (IS_ERR(tree))
+ return NULL;
return tree;
}