Slab: Fix memory leak in fallback_alloc()

The zonelist patches caused the loop that checks for available
objects in permitted zones to not terminate immediately. One object
per zone per allocation may be allocated and then abandoned.

Break the loop when we have successfully allocated one object.

Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by Christoph Lameter and committed by Linus Torvalds 481c5346 62a8efe6

+4 -1
+4 -1
mm/slab.c
··· 3263 3263 3264 3264 if (cpuset_zone_allowed_hardwall(zone, flags) && 3265 3265 cache->nodelists[nid] && 3266 - cache->nodelists[nid]->free_objects) 3266 + cache->nodelists[nid]->free_objects) { 3267 3267 obj = ____cache_alloc_node(cache, 3268 3268 flags | GFP_THISNODE, nid); 3269 + if (obj) 3270 + break; 3271 + } 3269 3272 } 3270 3273 3271 3274 if (!obj) {