Merge "cgroup: make sure a parent css isn't freed before its children"

This commit is contained in:
Linux Build Service Account 2016-09-24 02:00:30 -07:00 committed by Gerrit - the friendly Code Review server
commit a7186f9754

View file

@ -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);