From: Xiaotian Feng Date: Tue, 28 Jul 2009 07:11:14 +0000 (+0200) Subject: block: fix improper kobject release in blk_integrity_unregister X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=3839e4b;p=linux-beck.git block: fix improper kobject release in blk_integrity_unregister blk_integrity_unregister should use kobject_put to release the kobject, otherwise after bi is freed, memory of bi->kobj->name is leaked. Signed-off-by: Xiaotian Feng Signed-off-by: Jens Axboe --- diff --git a/block/blk-integrity.c b/block/blk-integrity.c index 73e28d355688..15c630813b1c 100644 --- a/block/blk-integrity.c +++ b/block/blk-integrity.c @@ -379,6 +379,7 @@ void blk_integrity_unregister(struct gendisk *disk) kobject_uevent(&bi->kobj, KOBJ_REMOVE); kobject_del(&bi->kobj); + kobject_put(&bi->kobj); kmem_cache_free(integrity_cachep, bi); disk->integrity = NULL; }