Skip to content

Commit 8291471

Browse files
RichardWeiYanghtejun
authored andcommitted
cgroup: get the wrong css for css_alloc() during cgroup_init_subsys()
css_alloc() needs the parent css, while cgroup_css() gets current cgropu's css. So we are getting the wrong css during cgroup_init_subsys(). Fortunately, cgrp_dfl_root.cgrp's css is not set yet, so the value we pass to css_alloc() is NULL anyway. Let's pass NULL directly during init, since we know there is no parent yet. Signed-off-by: Wei Yang <[email protected]> Signed-off-by: Tejun Heo <[email protected]>
1 parent eda0970 commit 8291471

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/cgroup/cgroup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5711,7 +5711,7 @@ static void __init cgroup_init_subsys(struct cgroup_subsys *ss, bool early)
57115711

57125712
/* Create the root cgroup state for this subsystem */
57135713
ss->root = &cgrp_dfl_root;
5714-
css = ss->css_alloc(cgroup_css(&cgrp_dfl_root.cgrp, ss));
5714+
css = ss->css_alloc(NULL);
57155715
/* We don't handle early failures gracefully */
57165716
BUG_ON(IS_ERR(css));
57175717
init_and_link_css(css, ss, &cgrp_dfl_root.cgrp);

0 commit comments

Comments
 (0)