diff options
author | Michal Hocko <mhocko@suse.cz> | 2013-07-08 16:00:27 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-13 11:39:18 -0700 |
commit | 3cfbfdc64a679a0f237a0e798e7cf034d26420d1 (patch) | |
tree | a35b838ae4284ef5757ceb1617616318668ac2d7 | |
parent | 65fd7aab590d38047cfafdfaac47282373bda37a (diff) |
Revert "memcg: avoid dangling reference count in creation failure"
commit fa460c2d37870e0a6f94c70e8b76d05ca11b6db0 upstream.
This reverts commit e4715f01be697a.
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: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Li Zefan <lizefan@huawei.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Glauber Costa <glommer@openvz.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | mm/memcontrol.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index f10c112974b..bd8b38031d0 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -6186,8 +6186,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; } |