Skip to content

Commit

Permalink
cgroup: fix uninitialised iterator in for_each_subsys_which
Browse files Browse the repository at this point in the history
Fix the fact that @ssid is uninitialised in the case where
CGROUP_SUBSYS_COUNT = 0 by setting ssid to 0.

Fixes: cb4a316 ("cgroup: use bitmask to filter for_each_subsys")
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
  • Loading branch information
Aleksa Sarai authored and Tejun Heo committed Jun 10, 2015
1 parent a966a4e commit 4a705c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down

0 comments on commit 4a705c5

Please sign in to comment.