slub: release kobject if sysfs_create_group failed in sysfs_slab_add
authorXiaotian Feng <dfeng@redhat.com>
Wed, 22 Jul 2009 03:28:53 +0000 (11:28 +0800)
committerPekka Enberg <penberg@cs.helsinki.fi>
Thu, 3 Sep 2009 18:11:41 +0000 (21:11 +0300)
commit5788d8ad6c113c589eeaaa48a173adbbe6b1cb3d
treed205f122f24be0853747be9c4d71049ed4e6d49f
parentacdfcd04d9df7d084ff752f82afad6ed4ad5f363
slub: release kobject if sysfs_create_group failed in sysfs_slab_add

When CONFIG_SLUB_DEBUG is enabled, sysfs_slab_add should unlink and put the
kobject if sysfs_create_group failed. Otherwise, sysfs_slab_add returns error
then free kmem_cache s, thus memory of s->kobj is leaked.

Acked-by: Christoph Lameter <cl@linux-foundation.org>
Signed-off-by: Xiaotian Feng <dfeng@redhat.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
mm/slub.c