summaryrefslogtreecommitdiffstats
path: root/kernel/cgroup.c
diff options
context:
space:
mode:
authorAleksa Sarai <cyphar@cyphar.com>2015-06-09 21:32:07 +1000
committerTejun Heo <tj@kernel.org>2015-06-10 13:48:30 +0900
commit4a705c5c786dc7f85051ed262bb05a4ca275dded (patch)
tree6a2d9511d1633bda38a158811850c9d326172f52 /kernel/cgroup.c
parenta966a4edf8d557a37446393439cd0db6612d4db8 (diff)
downloadlinux-4a705c5c786dc7f85051ed262bb05a4ca275dded.tar.bz2
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) \