diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-11-19 11:49:35 +0000 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-11-19 11:49:35 +0000 |
commit | 9e18e1869f5ebac69f0d881fe97a198ebc0834db (patch) | |
tree | 18c5b5c185d39cbb50fa652b5e08d047c8cf06e1 /mm/memcontrol.c | |
parent | 04af964f9cb666caa7c1436d003f8fac0f1fedcc (diff) | |
parent | 460ed699f4c943e1ec4a8458869eb532fe31fd16 (diff) |
Merge branch 'next-samsung-asoc' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung into for-2.6.38
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 9a99cfaf0a19..2efa8ea07ff7 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; } /* |