diff options
author | Michal Hocko <mhocko@suse.cz> | 2013-07-08 19:00:27 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-09 13:33:24 -0400 |
commit | fa460c2d37870e0a6f94c70e8b76d05ca11b6db0 (patch) | |
tree | 4bcee4af7ad147b1331e03910d66cc34c4e0e8dd /mm | |
parent | 493af578040e690f93f0fc8d9e7667ffff8155bb (diff) |
Revert "memcg: avoid dangling reference count in creation failure"
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>
Cc: <stable@vger.kernel.org> [3.9+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-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 64f726599ff0..6b73d8657d64 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -6352,8 +6352,6 @@ mem_cgroup_css_online(struct cgroup *cont) | |||
6352 | * call __mem_cgroup_free, so return directly | 6352 | * call __mem_cgroup_free, so return directly |
6353 | */ | 6353 | */ |
6354 | mem_cgroup_put(memcg); | 6354 | mem_cgroup_put(memcg); |
6355 | if (parent->use_hierarchy) | ||
6356 | mem_cgroup_put(parent); | ||
6357 | } | 6355 | } |
6358 | return error; | 6356 | return error; |
6359 | } | 6357 | } |