Merge "cgroup: make sure a parent css isn't freed before its children"
This commit is contained in:
commit
a7186f9754
1 changed files with 4 additions and 3 deletions
|
@ -4744,14 +4744,15 @@ static void css_free_work_fn(struct work_struct *work)
|
|||
|
||||
if (ss) {
|
||||
/* css free path */
|
||||
struct cgroup_subsys_state *parent = css->parent;
|
||||
int id = css->id;
|
||||
|
||||
if (css->parent)
|
||||
css_put(css->parent);
|
||||
|
||||
ss->css_free(css);
|
||||
cgroup_idr_remove(&ss->css_idr, id);
|
||||
cgroup_put(cgrp);
|
||||
|
||||
if (parent)
|
||||
css_put(parent);
|
||||
} else {
|
||||
/* cgroup free path */
|
||||
atomic_dec(&cgrp->root->nr_cgrps);
|
||||
|
|
Loading…
Add table
Reference in a new issue