aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/cgroup.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 1a06be61dcd0..fe00b3b983a8 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -2039,10 +2039,13 @@ int cgroupstats_build(struct cgroupstats *stats, struct dentry *dentry)
2039 struct cgroup *cgrp; 2039 struct cgroup *cgrp;
2040 struct cgroup_iter it; 2040 struct cgroup_iter it;
2041 struct task_struct *tsk; 2041 struct task_struct *tsk;
2042
2042 /* 2043 /*
2043 * Validate dentry by checking the superblock operations 2044 * Validate dentry by checking the superblock operations,
2045 * and make sure it's a directory.
2044 */ 2046 */
2045 if (dentry->d_sb->s_op != &cgroup_ops) 2047 if (dentry->d_sb->s_op != &cgroup_ops ||
2048 !S_ISDIR(dentry->d_inode->i_mode))
2046 goto err; 2049 goto err;
2047 2050
2048 ret = 0; 2051 ret = 0;