diff options
author | Paul Mundt <lethal@linux-sh.org> | 2010-11-15 13:54:00 +0900 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-11-15 13:54:00 +0900 |
commit | 344ac148442e3223ac1b0e29ef3d3fb73c5ed61a (patch) | |
tree | 7b654a74727c57344296768c3a2d7d03b17f37ea /mm/memcontrol.c | |
parent | 8ac5ba61cb1a80df407f2cdedb28b28d3b1d84ec (diff) | |
parent | 0143832cc96d0bf78486297aad5c8fb2c2ead02a (diff) | |
download | op-kernel-dev-344ac148442e3223ac1b0e29ef3d3fb73c5ed61a.zip op-kernel-dev-344ac148442e3223ac1b0e29ef3d3fb73c5ed61a.tar.gz |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into sh/urgent
Diffstat (limited to 'mm/memcontrol.c')
-rw-r--r-- | mm/memcontrol.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 9a99cfa..2efa8ea 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -4208,15 +4208,17 @@ static struct mem_cgroup *mem_cgroup_alloc(void) memset(mem, 0, size); mem->stat = alloc_percpu(struct mem_cgroup_stat_cpu); - if (!mem->stat) { - if (size < PAGE_SIZE) - kfree(mem); - else - vfree(mem); - mem = NULL; - } + if (!mem->stat) + goto out_free; spin_lock_init(&mem->pcp_counter_lock); return mem; + +out_free: + if (size < PAGE_SIZE) + kfree(mem); + else + vfree(mem); + return NULL; } /* |