Commit da0a12ca authored by Li Zefan's avatar Li Zefan Committed by Tejun Heo
Browse files

cgroup: fix a leak when percpu_ref_init() fails



ss->css_free() is not called when perfcpu_ref_init() fails.

Signed-off-by: default avatarLi Zefan <lizefan@huawei.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent 913ffdb5
...@@ -4344,8 +4344,10 @@ static long cgroup_create(struct cgroup *parent, struct dentry *dentry, ...@@ -4344,8 +4344,10 @@ static long cgroup_create(struct cgroup *parent, struct dentry *dentry,
} }
err = percpu_ref_init(&css->refcnt, css_release); err = percpu_ref_init(&css->refcnt, css_release);
if (err) if (err) {
ss->css_free(cgrp);
goto err_free_all; goto err_free_all;
}
init_cgroup_css(css, ss, cgrp); init_cgroup_css(css, ss, cgrp);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment