slub: sysfs_slab_remove should free kmem_cache when debug is enabled
Subsystems (2)
PATCH 1/1 slub: sysfs_slab_remove should free kmem_cache when debug is enabled
kmem_cache_destroy use sysfs_slab_remove to release the kmem_cache, but when CONFIG_SLUB_DEBUG is enabled, sysfs_slab_remove just release related kobject, the whole kmem_cache is missed to release and cause a memory leak.
--- mm/slub.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
mm/slub.c +1 -0
@@ -4559,6 +4559,7 @@ static void sysfs_slab_remove(struct kmem_cache *s)kobject_uevent (&s->kobj,KOBJ_REMOVE );kobject_del (&s->kobj);kobject_put (&s->kobj); +kfree (s); }/*
Signature · 7 lines
1.6.2.5 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Pekka Enberg
AppliedApplied, thanks!
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>