提交 e4715f01 编写于 作者: G Glauber Costa 提交者: Linus Torvalds

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: NGlauber Costa <glommer@parallels.com>
Reported-by: NMichal Hocko <mhocko@suse.cz>
Acked-by: NMichal 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: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 692e89ab
......@@ -6196,6 +6196,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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册