block: Fix double put in blk_integrity_unregister
[linux-3.10.git] / block / blk-integrity.c
index 69023da..e3817a0 100644 (file)
@@ -376,7 +376,7 @@ void blk_integrity_unregister(struct gendisk *disk)
 
        kobject_uevent(&bi->kobj, KOBJ_REMOVE);
        kobject_del(&bi->kobj);
-       kobject_put(&disk_to_dev(disk)->kobj);
        kmem_cache_free(integrity_cachep, bi);
+       disk->integrity = NULL;
 }
 EXPORT_SYMBOL(blk_integrity_unregister);