During cgroup_create(), we are sure who is our parent. Let's use parent directly instead of fetch it from cgroup hierarchy. Signed-off-by: Wei Yang <richard.weiyang@xxxxxxxxx> --- kernel/cgroup/cgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c index 457353aeb0ca..694b1c7803c2 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c @@ -5368,7 +5368,7 @@ static struct cgroup *cgroup_create(struct cgroup *parent, const char *name, cgrp->self.serial_nr = css_serial_nr_next++; /* allocation complete, commit to creation */ - list_add_tail_rcu(&cgrp->self.sibling, &cgroup_parent(cgrp)->self.children); + list_add_tail_rcu(&cgrp->self.sibling, &parent->self.children); atomic_inc(&root->nr_cgrps); cgroup_get_live(parent); -- 2.23.0