diff options
author | Li Zefan <lizefan@huawei.com> | 2014-02-14 03:55:04 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2014-02-14 10:52:40 -0500 |
commit | 6534fd6c15858fe4ce4ae568106225e68d5afa81 (patch) | |
tree | 895805085f542dfa62ce380d0d91d98d5fdb2283 | |
parent | bad34660344f37db8b55ce8bc139bddc7d83af1b (diff) |
cgroup: fix memory leak in cgroup_mount()
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>
-rw-r--r-- | kernel/cgroup.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 5606c0f08d95..3fe01102607b 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -1540,6 +1540,8 @@ retry: | |||
1540 | if (!atomic_inc_not_zero(&root->top_cgroup.refcnt)) { | 1540 | if (!atomic_inc_not_zero(&root->top_cgroup.refcnt)) { |
1541 | mutex_unlock(&cgroup_mutex); | 1541 | mutex_unlock(&cgroup_mutex); |
1542 | mutex_unlock(&cgroup_tree_mutex); | 1542 | mutex_unlock(&cgroup_tree_mutex); |
1543 | kfree(opts.release_agent); | ||
1544 | kfree(opts.name); | ||
1543 | msleep(10); | 1545 | msleep(10); |
1544 | goto retry; | 1546 | goto retry; |
1545 | } | 1547 | } |