Skip to content

Commit

Permalink
cgroup: fix memory leak in cgroup_rm_cftypes()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Li Zefan authored and Tejun Heo committed Jun 18, 2013
1 parent 1c8158e commit f57947d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernel/cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit f57947d

Please sign in to comment.