diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/slab.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -1282,13 +1282,18 @@ static int __cpuinit cpuup_prepare(long cpu) | |||
1282 | shared = alloc_arraycache(node, | 1282 | shared = alloc_arraycache(node, |
1283 | cachep->shared * cachep->batchcount, | 1283 | cachep->shared * cachep->batchcount, |
1284 | 0xbaadf00d); | 1284 | 0xbaadf00d); |
1285 | if (!shared) | 1285 | if (!shared) { |
1286 | kfree(nc); | ||
1286 | goto bad; | 1287 | goto bad; |
1288 | } | ||
1287 | } | 1289 | } |
1288 | if (use_alien_caches) { | 1290 | if (use_alien_caches) { |
1289 | alien = alloc_alien_cache(node, cachep->limit); | 1291 | alien = alloc_alien_cache(node, cachep->limit); |
1290 | if (!alien) | 1292 | if (!alien) { |
1293 | kfree(shared); | ||
1294 | kfree(nc); | ||
1291 | goto bad; | 1295 | goto bad; |
1296 | } | ||
1292 | } | 1297 | } |
1293 | cachep->array[cpu] = nc; | 1298 | cachep->array[cpu] = nc; |
1294 | l3 = cachep->nodelists[node]; | 1299 | l3 = cachep->nodelists[node]; |
@@ -1315,6 +1320,7 @@ static int __cpuinit cpuup_prepare(long cpu) | |||
1315 | } | 1320 | } |
1316 | return 0; | 1321 | return 0; |
1317 | bad: | 1322 | bad: |
1323 | cpuup_canceled(cpu); | ||
1318 | return -ENOMEM; | 1324 | return -ENOMEM; |
1319 | } | 1325 | } |
1320 | 1326 | ||