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-Url: https://git.stricted.de/?a=commitdiff_plain;h=da0a12caff;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.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 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);