Commit 4a705c5c authored by Aleksa Sarai's avatar Aleksa Sarai Committed by Tejun Heo

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: cb4a3167 ("cgroup: use bitmask to filter for_each_subsys")
Signed-off-by: default avatarAleksa Sarai <cyphar@cyphar.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent a966a4ed
...@@ -424,7 +424,7 @@ static int notify_on_release(const struct cgroup *cgrp) ...@@ -424,7 +424,7 @@ static int notify_on_release(const struct cgroup *cgrp)
*/ */
#define for_each_subsys_which(ss, ssid, ss_maskp) \ #define for_each_subsys_which(ss, ssid, ss_maskp) \
if (!CGROUP_SUBSYS_COUNT) /* to avoid spurious gcc warning */ \ if (!CGROUP_SUBSYS_COUNT) /* to avoid spurious gcc warning */ \
; \ (ssid) = 0; \
else \ else \
for_each_set_bit(ssid, ss_maskp, CGROUP_SUBSYS_COUNT) \ for_each_set_bit(ssid, ss_maskp, CGROUP_SUBSYS_COUNT) \
if (((ss) = cgroup_subsys[ssid]) && false) \ if (((ss) = cgroup_subsys[ssid]) && false) \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment