diff options
author | Christoph Lameter <clameter@sgi.com> | 2008-06-21 16:46:35 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-06-21 16:51:02 -0700 |
commit | 481c5346d0981940ee63037eb53e4e37b0735c10 (patch) | |
tree | 3fcae626ec4e1d4e698008671cfd62d794992ac5 | |
parent | 62a8efe632be1815b544845db643f1fcd9afcfb0 (diff) | |
download | op-kernel-dev-481c5346d0981940ee63037eb53e4e37b0735c10.zip op-kernel-dev-481c5346d0981940ee63037eb53e4e37b0735c10.tar.gz |
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>
-rw-r--r-- | mm/slab.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -3263,9 +3263,12 @@ retry: if (cpuset_zone_allowed_hardwall(zone, flags) && cache->nodelists[nid] && - cache->nodelists[nid]->free_objects) + cache->nodelists[nid]->free_objects) { obj = ____cache_alloc_node(cache, flags | GFP_THISNODE, nid); + if (obj) + break; + } } if (!obj) { |