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>
This commit is contained in:
Li Zefan 2013-06-18 18:41:53 +08:00 коммит произвёл Tejun Heo
Родитель 1c8158eeae
Коммит f57947d277
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -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;
}