block: Fix double put in blk_integrity_unregister
authorMartin K. Petersen <martin.petersen@oracle.com>
Wed, 1 Oct 2008 07:38:38 +0000 (03:38 -0400)
committerJens Axboe <jens.axboe@oracle.com>
Thu, 9 Oct 2008 06:56:21 +0000 (08:56 +0200)
- kobject_del already puts the parent.

 - Set integrity profile to NULL to prevent stale data.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
block/blk-integrity.c

index 69023da63151391cc229884d0fc8ff6c6b4afa5d..e3817a016a12cf1caa57cf6700ef871de0212b30 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);