Commit 9623e078c1f4692a91531af2f639ec8aff8f0472

Authored by Hugh Dickins
Committed by Linus Torvalds
1 parent 3ee1062b4e

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 <hugh@veritas.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 2 additions and 0 deletions Side-by-side Diff

... ... @@ -796,6 +796,8 @@
796 796  
797 797 if (mem_cgroup_subsys.disabled)
798 798 return 0;
  799 + if (!mm)
  800 + return 0;
799 801  
800 802 rcu_read_lock();
801 803 mem = mem_cgroup_from_task(rcu_dereference(mm->owner));