summaryrefslogtreecommitdiffstats
path: root/kernel/cgroup
diff options
context:
space:
mode:
authorKamalesh Babulal <kamalesh.babulal@oracle.com>2023-09-12 12:34:34 +0530
committerTejun Heo <tj@kernel.org>2023-09-18 08:57:22 -1000
commitfd55c0adb46a44c9a0630dc32509e4733c290103 (patch)
tree2d6c4effd628948ce3ac45352430c503f4fc0b0d /kernel/cgroup
parentce9ecca0238b140b88f43859b211c9fdfd8e5b70 (diff)
downloadlinux-fd55c0adb46a44c9a0630dc32509e4733c290103.tar.gz
linux-fd55c0adb46a44c9a0630dc32509e4733c290103.tar.bz2
linux-fd55c0adb46a44c9a0630dc32509e4733c290103.zip
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>
Diffstat (limited to 'kernel/cgroup')
-rw-r--r--kernel/cgroup/cgroup.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index 1fb7f562289d..d40d58b963c8 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -1731,8 +1731,10 @@ static int css_populate_dir(struct cgroup_subsys_state *css)
return ret;
}
} else {
- cgroup_addrm_files(css, cgrp,
- cgroup1_base_files, true);
+ ret = cgroup_addrm_files(css, cgrp,
+ cgroup1_base_files, true);
+ if (ret < 0)
+ return ret;
}
} else {
list_for_each_entry(cfts, &css->ss->cfts, node) {