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: cb4a316752 ("cgroup: use bitmask to filter for_each_subsys")
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
Aleksa Sarai 2015-06-09 21:32:07 +10:00 committed by Tejun Heo
parent a966a4edf8
commit 4a705c5c78

View File

@ -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) \