Skip to content

Commit

Permalink
cgroup: fix memory leak in cgroup_mount()
Browse files Browse the repository at this point in the history
We should free the memory allocated in parse_cgroupfs_options() before
calling this function again.

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 Feb 14, 2014
1 parent bad3466 commit 6534fd6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions kernel/cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -1540,6 +1540,8 @@ static struct dentry *cgroup_mount(struct file_system_type *fs_type,
if (!atomic_inc_not_zero(&root->top_cgroup.refcnt)) {
mutex_unlock(&cgroup_mutex);
mutex_unlock(&cgroup_tree_mutex);
kfree(opts.release_agent);
kfree(opts.name);
msleep(10);
goto retry;
}
Expand Down

0 comments on commit 6534fd6

Please sign in to comment.