Skip to content

Commit aa4a860

Browse files
gregkhtehcaster
authored andcommitted
mm/slub: fix memory leak with using debugfs_lookup()
When calling debugfs_lookup() the result must have dput() called on it, otherwise the memory will leak over time. To make things simpler, just call debugfs_lookup_and_remove() instead which handles all of the logic at once. Cc: Christoph Lameter <[email protected]> Cc: Pekka Enberg <[email protected]> Cc: David Rientjes <[email protected]> Cc: Joonsoo Kim <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Vlastimil Babka <[email protected]> Cc: Roman Gushchin <[email protected]> Cc: Hyeonggon Yoo <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]> Reviewed-by: Hyeonggon Yoo <[email protected]> Acked-by: Roman Gushchin <[email protected]> Acked-by: David Rientjes <[email protected]> Signed-off-by: Vlastimil Babka <[email protected]>
1 parent 88603b6 commit aa4a860

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/slub.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6449,7 +6449,7 @@ static void debugfs_slab_add(struct kmem_cache *s)
64496449

64506450
void debugfs_slab_release(struct kmem_cache *s)
64516451
{
6452-
debugfs_remove_recursive(debugfs_lookup(s->name, slab_debugfs_root));
6452+
debugfs_lookup_and_remove(s->name, slab_debugfs_root);
64536453
}
64546454

64556455
static int __init slab_debugfs_init(void)

0 commit comments

Comments
 (0)