diff options
author | Li Zefan <lizefan@huawei.com> | 2013-07-31 16:16:28 +0800 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2013-07-31 06:13:25 -0400 |
commit | da0a12caffad2eeadea429f83818408e7b77379a (patch) | |
tree | 3ff7fa3a5b2156066b442ef126db9dacab008c87 /kernel | |
parent | 913ffdb54366f94eec65c656cae8c6e00e1ab1b0 (diff) | |
download | linux-da0a12caffad2eeadea429f83818408e7b77379a.tar.bz2 |
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, } err = percpu_ref_init(&css->refcnt, css_release); - if (err) + if (err) { + ss->css_free(cgrp); goto err_free_all; + } init_cgroup_css(css, ss, cgrp); |