diff options
author | Li Zefan <lizefan@huawei.com> | 2013-07-31 04:16:28 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2013-07-31 06:13:25 -0400 |
commit | da0a12caffad2eeadea429f83818408e7b77379a (patch) | |
tree | 3ff7fa3a5b2156066b442ef126db9dacab008c87 /kernel | |
parent | 913ffdb54366f94eec65c656cae8c6e00e1ab1b0 (diff) |
cgroup: fix a leak when percpu_ref_init() fails
ss->css_free() is not called when perfcpu_ref_init() fails.
Signed-off-by: Li Zefan <lizefan@huawei.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/cgroup.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index afb8d53ca6c7..468e410f9e61 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -4344,8 +4344,10 @@ static long cgroup_create(struct cgroup *parent, struct dentry *dentry, | |||
4344 | } | 4344 | } |
4345 | 4345 | ||
4346 | err = percpu_ref_init(&css->refcnt, css_release); | 4346 | err = percpu_ref_init(&css->refcnt, css_release); |
4347 | if (err) | 4347 | if (err) { |
4348 | ss->css_free(cgrp); | ||
4348 | goto err_free_all; | 4349 | goto err_free_all; |
4350 | } | ||
4349 | 4351 | ||
4350 | init_cgroup_css(css, ss, cgrp); | 4352 | init_cgroup_css(css, ss, cgrp); |
4351 | 4353 | ||