From: Andrew Morton Date: Wed, 20 Feb 2013 02:14:44 +0000 (+1100) Subject: memcg-reduce-the-size-of-struct-memcg-244-fold-fix X-Git-Tag: next-20130220~1^2~448 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=6693e0ab3c8610f802eedb8add1b43ab1a3ff6a7;p=karo-tx-linux.git memcg-reduce-the-size-of-struct-memcg-244-fold-fix add check for invalid nid, remove inline Cc: Glauber Costa Cc: Greg Thelen Cc: Hugh Dickins Cc: Johannes Weiner Cc: Kamezawa Hiroyuki Cc: Mel Gorman Cc: Michal Hocko Cc: Rik van Riel Cc: Ying Han Signed-off-by: Andrew Morton --- diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 7e760c65425a..9e94bbbd3a67 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -381,7 +381,7 @@ enum { ((1 << KMEM_ACCOUNTED_ACTIVE) | (1 << KMEM_ACCOUNTED_ACTIVATED)) #ifdef CONFIG_MEMCG_KMEM -static inline void memcg_kmem_set_active(struct mem_cgroup *memcg) +static void memcg_kmem_set_active(struct mem_cgroup *memcg) { set_bit(KMEM_ACCOUNTED_ACTIVE, &memcg->kmem_account_flags); } @@ -645,6 +645,7 @@ static void drain_all_stock_async(struct mem_cgroup *memcg); static struct mem_cgroup_per_zone * mem_cgroup_zoneinfo(struct mem_cgroup *memcg, int nid, int zid) { + VM_BUG_ON((unsigned)nid >= nr_node_ids); return &memcg->info.nodeinfo[nid]->zoneinfo[zid]; }