From: JP Kobryn Date: Thu, 24 Apr 2025 17:53:58 +0000 (-0700) Subject: cgroup: fix goto ordering in cgroup_init() X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=f304da9134f8c245d198502ad681ffae63b5e29c;p=users%2Fdwmw2%2Flinux.git cgroup: fix goto ordering in cgroup_init() Go to the appropriate section labels when css_rstat_init() or psi_cgroup_alloc() fails. Signed-off-by: JP Kobryn Fixes: a97915559f5c ("cgroup: change rstat function signatures from cgroup-based to css-based") Signed-off-by: Tejun Heo --- diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c index c284df1efc9fd..7471811a00de2 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c @@ -5708,11 +5708,11 @@ static struct cgroup *cgroup_create(struct cgroup *parent, const char *name, */ ret = css_rstat_init(&cgrp->self); if (ret) - goto out_stat_exit; + goto out_kernfs_remove; ret = psi_cgroup_alloc(cgrp); if (ret) - goto out_kernfs_remove; + goto out_stat_exit; if (cgrp->root == &cgrp_dfl_root) { ret = cgroup_bpf_inherit(cgrp);