/* Description: This function frees all memory used by the block integrity profile. To be called at device teardown.  */
void blk_integrity_unregister(struct gendisk *disk)
/* Description: This function frees all memory used by the block integrity profile. To be called at device teardown.  */
void blk_integrity_unregister(struct gendisk *disk)
{
	struct blk_integrity *bi;
	if (!disk || !disk->integrity)
		return;
	bi = disk->integrity;
	kobject_uevent(&bi->kobj, KOBJ_REMOVE);
	kobject_del(&bi->kobj);
	kobject_put(&bi->kobj);
	kmem_cache_free(integrity_cachep, bi);
	disk->integrity = NULL;
}