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-Tag: firefly_0821_release~13254^2~2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3839e4b29b4385e4b31075e7805683e2aa2a8103;p=firefly-linux-kernel-4.4.55.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; }