Skip to content

Commit

Permalink
memcg: fix oops in mem_cgroup_shrink_usage
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Hugh Dickins authored and torvalds committed Aug 12, 2008
1 parent 3ee1062 commit 9623e07
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mm/memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 9623e07

Please sign in to comment.