mm: memcontrol: don't pass a NULL memcg to mem_cgroup_end_move()
authorJohannes Weiner <hannes@cmpxchg.org>
Wed, 10 Dec 2014 23:44:08 +0000 (15:44 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 11 Dec 2014 01:41:07 +0000 (17:41 -0800)
commit4e2f245d38ba86e3922c6c188fe4a0d0688aed88
tree8d4f91042e2ede102bd94236543f5cd5a97a5592
parent354a4783a2ee5ba1cb5a1442cca8ecd4c0ac6d66
mm: memcontrol: don't pass a NULL memcg to mem_cgroup_end_move()

mem_cgroup_end_move() checks if the passed memcg is NULL, along with a
lengthy comment to explain why this seemingly non-sensical situation is
even possible.

Check in cancel_attach() itself whether can_attach() set up the move
context or not, it's a lot more obvious from there.  Then remove the check
and comment in mem_cgroup_end_move().

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Vladimir Davydov <vdavydov@parallels.com>
Acked-by: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/memcontrol.c