diff options
-rw-r--r-- | kernel/cgroup.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index b316debadeb3..5cea63fe4095 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -760,9 +760,11 @@ static void put_css_set_locked(struct css_set *cset) | |||
760 | if (!atomic_dec_and_test(&cset->refcount)) | 760 | if (!atomic_dec_and_test(&cset->refcount)) |
761 | return; | 761 | return; |
762 | 762 | ||
763 | /* This css_set is dead. unlink it and release cgroup refcounts */ | 763 | /* This css_set is dead. unlink it and release cgroup and css refs */ |
764 | for_each_subsys(ss, ssid) | 764 | for_each_subsys(ss, ssid) { |
765 | list_del(&cset->e_cset_node[ssid]); | 765 | list_del(&cset->e_cset_node[ssid]); |
766 | css_put(cset->subsys[ssid]); | ||
767 | } | ||
766 | hash_del(&cset->hlist); | 768 | hash_del(&cset->hlist); |
767 | css_set_count--; | 769 | css_set_count--; |
768 | 770 | ||
@@ -1062,9 +1064,13 @@ static struct css_set *find_css_set(struct css_set *old_cset, | |||
1062 | key = css_set_hash(cset->subsys); | 1064 | key = css_set_hash(cset->subsys); |
1063 | hash_add(css_set_table, &cset->hlist, key); | 1065 | hash_add(css_set_table, &cset->hlist, key); |
1064 | 1066 | ||
1065 | for_each_subsys(ss, ssid) | 1067 | for_each_subsys(ss, ssid) { |
1068 | struct cgroup_subsys_state *css = cset->subsys[ssid]; | ||
1069 | |||
1066 | list_add_tail(&cset->e_cset_node[ssid], | 1070 | list_add_tail(&cset->e_cset_node[ssid], |
1067 | &cset->subsys[ssid]->cgroup->e_csets[ssid]); | 1071 | &css->cgroup->e_csets[ssid]); |
1072 | css_get(css); | ||
1073 | } | ||
1068 | 1074 | ||
1069 | spin_unlock_bh(&css_set_lock); | 1075 | spin_unlock_bh(&css_set_lock); |
1070 | 1076 | ||