diff options
author | Xiaotian Feng <dfeng@redhat.com> | 2009-07-28 03:11:14 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2009-07-28 03:11:14 -0400 |
commit | 3839e4b29b4385e4b31075e7805683e2aa2a8103 (patch) | |
tree | 48481cbd67b72e2a62f304daff2a7d3cf86bd1f4 | |
parent | a4e7d46407d73f35d217013b363b79a8f8eafcaa (diff) |
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 <dfeng@redhat.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
-rw-r--r-- | block/blk-integrity.c | 1 |
1 files changed, 1 insertions, 0 deletions
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) | |||
379 | 379 | ||
380 | kobject_uevent(&bi->kobj, KOBJ_REMOVE); | 380 | kobject_uevent(&bi->kobj, KOBJ_REMOVE); |
381 | kobject_del(&bi->kobj); | 381 | kobject_del(&bi->kobj); |
382 | kobject_put(&bi->kobj); | ||
382 | kmem_cache_free(integrity_cachep, bi); | 383 | kmem_cache_free(integrity_cachep, bi); |
383 | disk->integrity = NULL; | 384 | disk->integrity = NULL; |
384 | } | 385 | } |