Skip to content

Commit

Permalink
block: fix improper kobject release in blk_integrity_unregister
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Xiaotian Feng authored and Jens Axboe committed Jul 28, 2009
1 parent a4e7d46 commit 3839e4b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions block/blk-integrity.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 3839e4b

Please sign in to comment.