aboutsummaryrefslogtreecommitdiff
path: root/kernel/cgroup.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/cgroup.c')
-rw-r--r--kernel/cgroup.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index eaf81200b793..e27ba6734f13 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -4779,6 +4779,7 @@ static void init_and_link_css(struct cgroup_subsys_state *css,
memset(css, 0, sizeof(*css));
css->cgroup = cgrp;
css->ss = ss;
+ css->id = -1;
INIT_LIST_HEAD(&css->sibling);
INIT_LIST_HEAD(&css->children);
css->serial_nr = css_serial_nr_next++;
@@ -4864,7 +4865,7 @@ static int create_css(struct cgroup *cgrp, struct cgroup_subsys *ss,
err = cgroup_idr_alloc(&ss->css_idr, NULL, 2, 0, GFP_KERNEL);
if (err < 0)
- goto err_free_percpu_ref;
+ goto err_free_css;
css->id = err;
if (visible) {
@@ -4896,9 +4897,6 @@ err_list_del:
list_del_rcu(&css->sibling);
css_clear_dir(css, NULL);
err_free_id:
- cgroup_idr_remove(&ss->css_idr, css->id);
-err_free_percpu_ref:
- percpu_ref_exit(&css->refcnt);
err_free_css:
call_rcu(&css->rcu_head, css_free_rcu_fn);
return err;