]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
If somebody is touching data too early, it might be easier to diagnose a
authorIgor Mammedov <imammedo@redhat.com>
Wed, 24 Aug 2011 23:47:42 +0000 (09:47 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 9 Sep 2011 06:16:23 +0000 (16:16 +1000)
problem when dereferencing NULL at mem->info.nodeinfo[node] than trying to
understand why mem_cgroup_per_zone is [un|partly]initialized.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Acked-by: Michal Hocko <mhocko@suse.cz>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/memcontrol.c

index 7e38d84f5163138ae63fa02160e6045f238ba744..f367fadefe2f723a04772a6fcb1dde7c8882990a 100644 (file)
@@ -4905,7 +4905,6 @@ static int alloc_mem_cgroup_per_zone_info(struct mem_cgroup *memcg, int node)
        if (!pn)
                return 1;
 
-       memcg->info.nodeinfo[node] = pn;
        for (zone = 0; zone < MAX_NR_ZONES; zone++) {
                mz = &pn->zoneinfo[zone];
                for_each_lru(l)
@@ -4914,6 +4913,7 @@ static int alloc_mem_cgroup_per_zone_info(struct mem_cgroup *memcg, int node)
                mz->on_tree = false;
                mz->mem = memcg;
        }
+       memcg->info.nodeinfo[node] = pn;
        return 0;
 }