summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2013-05-24 05:50:24 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-06-07 23:53:07 +0400
commite92b3f9342bd09ba9707d0500b46c6500de1b1fc (patch)
tree5e9f65e15c43bb2ad73dce17f50fcb11220d2ba3 /arch
parent24622f8bb1d75e005f6cd1ccaea82b72e31b6d6c (diff)
downloadlinux-e92b3f9342bd09ba9707d0500b46c6500de1b1fc.tar.xz
cgroup: fix a subtle bug in descendant pre-order walk
commit 7805d000db30a3787a4c969bab6ae4d8a5fd8ce6 upstream. When cgroup_next_descendant_pre() initiates a walk, it checks whether the subtree root doesn't have any children and if not returns NULL. Later code assumes that the subtree isn't empty. This is broken because the subtree may become empty inbetween, which can lead to the traversal escaping the subtree by walking to the sibling of the subtree root. There's no reason to have the early exit path. Remove it along with the later assumption that the subtree isn't empty. This simplifies the code a bit and fixes the subtle bug. While at it, fix the comment of cgroup_for_each_descendant_pre() which was incorrectly referring to ->css_offline() instead of ->css_online(). Signed-off-by: Tejun Heo <tj@kernel.org> Reviewed-by: Michal Hocko <mhocko@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch')
0 files changed, 0 insertions, 0 deletions