Skip to contentSkip to conversation

cgroup: fix goto ordering in cgroup_init()

PATCH Applied JP Kobryn 2 participants 2 messages Apr 24, 2025 cgroup

lore
Share & tools
lore

JP Kobryn

author
#0 lore raw

PATCH 1/1 cgroup: fix goto ordering in cgroup_init()

Go to the appropriate section labels when css_rstat_init() or psi_cgroup_alloc() fails.

This is intended for branch "for-6.16" on "tj/cgroup.git".

Fixes a97915559f5c ("cgroup: change rstat function signatures from cgroup-based to css-based")
---
 kernel/cgroup/cgroup.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/cgroup/cgroup.c +2 -2
index c284df1efc9f..7471811a00de 100644
@@ -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);
Signature · 1 line
2.47.1
maintainer Applied
#1 lore raw
Quoted 4 lines · JP Kobryn

Go to the appropriate section labels when css_rstat_init() or psi_cgroup_alloc() fails.

This is intended for branch "for-6.16" on "tj/cgroup.git".

I think the more common convention for saying the above is using "[PATCH cgroup/for-6.16]" in the subject line.

Quoted 2 lines
Fixes a97915559f5c ("cgroup: change rstat function signatures from cgroup-based to css-based")

Applied to cgroup/for-6.16.

Thanks.

Signature · 1 line
tejun