From: Li Zefan Date: Wed, 31 Jul 2013 08:16:28 +0000 (+0800) Subject: cgroup: fix a leak when percpu_ref_init() fails X-Git-Tag: v3.11-rc6~1^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=da0a12caffad2eeadea429f83818408e7b77379a;p=platform%2Fkernel%2Flinux-stable.git 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 Signed-off-by: Tejun Heo --- diff --git a/kernel/cgroup.c b/kernel/cgroup.c index afb8d53..468e410 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);