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>
This commit is contained in:
parent
913ffdb543
commit
da0a12caff
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue