Commit 12d00f6a authored by Akinobu Mita's avatar Akinobu Mita Committed by Linus Torvalds
Browse files

cpu hotplug: slab: fix memory leak in cpu hotplug error path

This patch fixes memory leak in error path.

In reality, we don't need to call cpuup_canceled(cpu) for now.  But upcoming
cpu hotplug error handling change needs this.

Cc: Christoph Lameter <>
Cc: Gautham R Shenoy <>
Acked-by: default avatarPekka Enberg <>
Signed-off-by: default avatarAkinobu Mita <>
Cc: Gautham R Shenoy <>
Cc: Oleg Nesterov <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent fbf1e473
......@@ -1282,13 +1282,18 @@ static int __cpuinit cpuup_prepare(long cpu)
shared = alloc_arraycache(node,
cachep->shared * cachep->batchcount,
if (!shared)
if (!shared) {
goto bad;
if (use_alien_caches) {
alien = alloc_alien_cache(node, cachep->limit);
if (!alien)
if (!alien) {
goto bad;
cachep->array[cpu] = nc;
l3 = cachep->nodelists[node];
......@@ -1315,6 +1320,7 @@ static int __cpuinit cpuup_prepare(long cpu)
return 0;
return -ENOMEM;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment