Skip to content

Commit fd55c0a

Browse files
kamalesh-babulalhtejun
authored andcommitted
cgroup: Check for ret during cgroup1_base_files cft addition
There is no check for possible failure while populating cgroup1_base_files cft in css_populate_dir(), like its cgroup v2 counter parts cgroup_{base,psi}_files. In case of failure, the cgroup might not be set up right. Add ret value check to return on failure. Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com> Signed-off-by: Tejun Heo <tj@kernel.org>
1 parent ce9ecca commit fd55c0a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

kernel/cgroup/cgroup.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1731,8 +1731,10 @@ static int css_populate_dir(struct cgroup_subsys_state *css)
17311731
return ret;
17321732
}
17331733
} else {
1734-
cgroup_addrm_files(css, cgrp,
1735-
cgroup1_base_files, true);
1734+
ret = cgroup_addrm_files(css, cgrp,
1735+
cgroup1_base_files, true);
1736+
if (ret < 0)
1737+
return ret;
17361738
}
17371739
} else {
17381740
list_for_each_entry(cfts, &css->ss->cfts, node) {

0 commit comments

Comments
 (0)