summaryrefslogtreecommitdiffstats
path: root/kernel/cgroup.c
diff options
context:
space:
mode:
authorAleksa Sarai <cyphar@cyphar.com>2015-06-09 13:32:07 +0200
committerTejun Heo <tj@kernel.org>2015-06-10 06:48:30 +0200
commit4a705c5c786dc7f85051ed262bb05a4ca275dded (patch)
tree6a2d9511d1633bda38a158811850c9d326172f52 /kernel/cgroup.c
parentcgroup: replace explicit ss_mask checking with for_each_subsys_which (diff)
downloadlinux-4a705c5c786dc7f85051ed262bb05a4ca275dded.tar.xz
linux-4a705c5c786dc7f85051ed262bb05a4ca275dded.zip
cgroup: fix uninitialised iterator in for_each_subsys_which
Fix the fact that @ssid is uninitialised in the case where CGROUP_SUBSYS_COUNT = 0 by setting ssid to 0. Fixes: cb4a31675270 ("cgroup: use bitmask to filter for_each_subsys") Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/cgroup.c')
-rw-r--r--kernel/cgroup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 6d6d3c752096..12b580f4338e 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -424,7 +424,7 @@ static int notify_on_release(const struct cgroup *cgrp)
*/
#define for_each_subsys_which(ss, ssid, ss_maskp) \
if (!CGROUP_SUBSYS_COUNT) /* to avoid spurious gcc warning */ \
- ; \
+ (ssid) = 0; \
else \
for_each_set_bit(ssid, ss_maskp, CGROUP_SUBSYS_COUNT) \
if (((ss) = cgroup_subsys[ssid]) && false) \