mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 04:01:48 -04:00
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 <[email protected]> Cc: Gautham R Shenoy <[email protected]> Acked-by: Pekka Enberg <[email protected]> Signed-off-by: Akinobu Mita <[email protected]> Cc: Gautham R Shenoy <[email protected]> Cc: Oleg Nesterov <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
fbf1e473bd
commit
12d00f6a12
1 changed files with 8 additions and 2 deletions
10
mm/slab.c
10
mm/slab.c
|
|
@ -1282,13 +1282,18 @@ static int __cpuinit cpuup_prepare(long cpu)
|
|||
shared = alloc_arraycache(node,
|
||||
cachep->shared * cachep->batchcount,
|
||||
0xbaadf00d);
|
||||
if (!shared)
|
||||
if (!shared) {
|
||||
kfree(nc);
|
||||
goto bad;
|
||||
}
|
||||
}
|
||||
if (use_alien_caches) {
|
||||
alien = alloc_alien_cache(node, cachep->limit);
|
||||
if (!alien)
|
||||
if (!alien) {
|
||||
kfree(shared);
|
||||
kfree(nc);
|
||||
goto bad;
|
||||
}
|
||||
}
|
||||
cachep->array[cpu] = nc;
|
||||
l3 = cachep->nodelists[node];
|
||||
|
|
@ -1315,6 +1320,7 @@ static int __cpuinit cpuup_prepare(long cpu)
|
|||
}
|
||||
return 0;
|
||||
bad:
|
||||
cpuup_canceled(cpu);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue