summaryrefslogtreecommitdiff
path: root/kernel/cgroup.c
diff options
context:
space:
mode:
authorLi Zefan <lizefan@huawei.com>2013-06-18 18:41:53 +0800
committerTejun Heo <tj@kernel.org>2013-06-18 09:04:30 -0700
commitf57947d27711451a7739a25bba6cddc8a385e438 (patch)
treec9818b178724a5968384e1a28060088f7a153f87 /kernel/cgroup.c
parent1c8158eeae0f37d0eee9f1fbe68080df6a408df2 (diff)
cgroup: fix memory leak in cgroup_rm_cftypes()
The memory allocated in cgroup_add_cftypes() should be freed. The effect of this bug is we leak a bit memory everytime we unload cfq-iosched module if blkio cgroup is enabled. Signed-off-by: Li Zefan <lizefan@huawei.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/cgroup.c')
-rw-r--r--kernel/cgroup.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 7db2940bfc77..1d4f471de8d5 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -2889,7 +2889,8 @@ int cgroup_rm_cftypes(struct cgroup_subsys *ss, struct cftype *cfts)
list_for_each_entry(set, &ss->cftsets, node) {
if (set->cfts == cfts) {
- list_del_init(&set->node);
+ list_del(&set->node);
+ kfree(set);
cgroup_cfts_commit(ss, cfts, false);
return 0;
}