• Christoph Lameter's avatar
    [PATCH] slab: fix memory leak in alloc_kmemlist · 0718dc2a
    Christoph Lameter authored
    We have had this memory leak for a while now.  The situation is complicated
    by the use of alloc_kmemlist() as a function to resize various caches by
    What we do here is first of all make sure that we deallocate properly in
    the loop over all the nodes.
    If we are just resizing caches then we can simply return with -ENOMEM if an
    allocation fails.
    If the cache is new then we need to rollback and remove all earlier
    We detect that a cache is new by checking if the link to the global cache
    chain has been setup.  This is a bit hackish ....
    (also fix up too overlong lines that I added in the last patch...)
    Signed-off-by: default avatarChristoph Lameter <clameter@sgi.com>
    Cc: Jesper Juhl <jesper.juhl@gmail.com>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
slab.c 107 KB