diff options
author | Glauber Costa <glommer@parallels.com> | 2013-02-07 12:26:58 +1100 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2013-02-14 15:25:38 +1100 |
commit | 8124c52a1ba4d3200a7382a1f19923a23a2d4adb (patch) | |
tree | 25b6371cb27b973a62a6b1216bc1a7420272602c /mm | |
parent | 8d6f94134e186ec7442f5de956e7a6af3ce131de (diff) |
memcg: avoid dangling reference count in creation failure.
When use_hierarchy is enabled, we acquire an extra reference count in our
parent during cgroup creation. We don't release it, though, if any
failure exist in the creation process.
Signed-off-by: Glauber Costa <glommer@parallels.com>
Reported-by: Michal Hocko <mhocko@suse.cz>
Acked-by: Michal Hocko <mhocko@suse.cz>
Cc: Tejun Heo <tj@kernel.org>
Cc: Hiroyuki Kamezawa <kamezawa.hiroyuki@gmail.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/memcontrol.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index f9592450dbe3..2fd0efd45666 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -6197,6 +6197,8 @@ mem_cgroup_css_online(struct cgroup *cont) * call __mem_cgroup_free, so return directly */ mem_cgroup_put(memcg); + if (parent->use_hierarchy) + mem_cgroup_put(parent); } return error; } |