]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
cgroup: fix goto ordering in cgroup_init()
authorJP Kobryn <inwardvessel@gmail.com>
Thu, 24 Apr 2025 17:53:58 +0000 (10:53 -0700)
committerTejun Heo <tj@kernel.org>
Thu, 24 Apr 2025 18:36:57 +0000 (08:36 -1000)
Go to the appropriate section labels when css_rstat_init() or
psi_cgroup_alloc() fails.

Signed-off-by: JP Kobryn <inwardvessel@gmail.com>
Fixes: a97915559f5c ("cgroup: change rstat function signatures from cgroup-based to css-based")
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/cgroup/cgroup.c

index c284df1efc9fdd9108465e60e75c229b8873a202..7471811a00de27cb823cbd3391df76b8ea16a4ea 100644 (file)
@@ -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);