summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLi Zefan <lizefan@huawei.com>2014-06-12 08:31:31 +0200
committerTejun Heo <tj@kernel.org>2014-06-18 00:52:53 +0200
commit99bae5f94185c2cc65701e95c54e31e2f4345b88 (patch)
tree9cb7db676c228bd7e3ea9fbd221a6303ca2628ee /kernel
parentepoll: fix use-after-free in eventpoll_release_file (diff)
downloadlinux-99bae5f94185c2cc65701e95c54e31e2f4345b88.tar.xz
linux-99bae5f94185c2cc65701e95c54e31e2f4345b88.zip
cgroup: fix broken css_has_online_children()
After running: # mount -t cgroup cpu xxx /cgroup && mkdir /cgroup/sub && \ rmdir /cgroup/sub && umount /cgroup I found the cgroup root still existed: # cat /proc/cgroups #subsys_name hierarchy num_cgroups enabled cpuset 0 1 1 cpu 1 1 1 ... It turned out css_has_online_children() is broken. Signed-off-by: Li Zefan <lizefan@huawei.com> Sigend-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/cgroup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 7868fc3c0bc5..d9a8be911f5b 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -3328,7 +3328,7 @@ bool css_has_online_children(struct cgroup_subsys_state *css)
rcu_read_lock();
css_for_each_child(child, css) {
- if (css->flags & CSS_ONLINE) {
+ if (child->flags & CSS_ONLINE) {
ret = true;
break;
}