Messages in this thread Patch in this message | | | Date | Mon, 8 Apr 2013 14:33:35 +0800 | From | Li Zefan <> | Subject | [PATCH 03/12] Revert "memcg: avoid dangling reference count in creation failure." |
| |
From: Michal Hocko <mhocko@suse.cz>
This reverts commit e4715f01be697a3730c78f8ffffb595591d6a88c
mem_cgroup_put is hierarchy aware so mem_cgroup_put(memcg) already drops an additional reference from all parents so the additional mem_cgrroup_put(parent) potentially causes use-after-free.
Signed-off-by: Li Zefan <lizefan@huawei.com> Signed-off-by: Michal Hocko <mhocko@suse.cz> --- mm/memcontrol.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 2364f4e..44cec72 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -6250,8 +6250,6 @@ 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; } -- 1.8.0.2
| |