diff options
author | Aleksa Sarai <cyphar@cyphar.com> | 2015-06-09 21:32:07 +1000 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2016-06-08 11:09:04 +0800 |
commit | 08394babdde65216de3a9d7f0c4ba23278937efc (patch) | |
tree | 56fddb14137907f015c117fe76e35029fefb9f4a | |
parent | 55c0cebdf7a85eb9d4db0ed19757f04a02fe622e (diff) |
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>
(cherry picked from commit 4a705c5c786dc7f85051ed262bb05a4ca275dded)
Signed-off-by: Alex Shi <alex.shi@linaro.org>
-rw-r--r-- | kernel/cgroup.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 40b43cbc2463..d974a50220f5 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c @@ -425,7 +425,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) \ |