diff options
| author | Michal Marek <[email protected]> | 2010-12-01 13:13:56 +0100 |
|---|---|---|
| committer | Michal Marek <[email protected]> | 2010-12-01 13:13:56 +0100 |
| commit | 307991055b0ce65d53dc1eb501c456c10eb36360 (patch) | |
| tree | 71bb9263dc71344e5d7b97ca6d5cf223f1f1a856 /mm/memcontrol.c | |
| parent | 1198c6d45a1ef5f4f7fdfbf33ef7d270493ec575 (diff) | |
| parent | 9b4320b77bab4031649c484da1c595f39c2e43cd (diff) | |
Merge branch 'kconfig_fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-next into kbuild/rc-fixes
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; } /* |