From: Hugh Dickins Date: Tue, 12 Aug 2008 22:08:41 +0000 (-0700) Subject: memcg: fix oops in mem_cgroup_shrink_usage X-Git-Tag: v2.6.27-rc3~38 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=9623e078c1f4692a91531af2f639ec8aff8f0472;p=linux-2.6-omap-h63xx.git memcg: fix oops in mem_cgroup_shrink_usage Got an oops in mem_cgroup_shrink_usage() when testing loop over tmpfs: yes, of course, loop0 has no mm: other entry points check but this didn't. Signed-off-by: Hugh Dickins Cc: KAMEZAWA Hiroyuki Acked-by: Balbir Singh Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 7056c3bdb47..0f1f7a7374b 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -796,6 +796,8 @@ int mem_cgroup_shrink_usage(struct mm_struct *mm, gfp_t gfp_mask) if (mem_cgroup_subsys.disabled) return 0; + if (!mm) + return 0; rcu_read_lock(); mem = mem_cgroup_from_task(rcu_dereference(mm->owner));