summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAsai Thambi SP <asamymuthupa@micron.com>2015-05-11 15:48:00 -0700
committerJens Axboe <axboe@fb.com>2015-06-16 08:24:40 -0600
commit02b48265e7437bfe153af16337b14ee74f00905f (patch)
tree570923bf4a79a4a41f44fb399f87424580a87811
parent3715a5d014e1326b8e6d008dfbf05615014a067e (diff)
mtip32xx: fix rmmod issue
put_disk() need to be called after del_gendisk() to free the disk object structure. Signed-off-by: Selvan Mani <smani@micron.com> Signed-off-by: Asai Thambi S P <asamymuthupa@micron.com> Signed-off-by: Jens Axboe <axboe@fb.com>
-rw-r--r--drivers/block/mtip32xx/mtip32xx.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c
index 3bd7ca9853a8..b79b59a696f1 100644
--- a/drivers/block/mtip32xx/mtip32xx.c
+++ b/drivers/block/mtip32xx/mtip32xx.c
@@ -2809,6 +2809,7 @@ static int mtip_free_orphan(struct driver_data *dd)
kobject_put(kobj);
}
del_gendisk(dd->disk);
+ put_disk(dd->disk);
dd->disk = NULL;
}
if (dd->queue) {
@@ -4095,13 +4096,13 @@ static int mtip_block_remove(struct driver_data *dd)
dd->bdev = NULL;
}
if (dd->disk) {
+ del_gendisk(dd->disk);
if (dd->disk->queue) {
- del_gendisk(dd->disk);
blk_cleanup_queue(dd->queue);
blk_mq_free_tag_set(&dd->tags);
dd->queue = NULL;
- } else
- put_disk(dd->disk);
+ }
+ put_disk(dd->disk);
}
dd->disk = NULL;
@@ -4140,12 +4141,12 @@ static int mtip_block_shutdown(struct driver_data *dd)
dev_info(&dd->pdev->dev,
"Shutting down %s ...\n", dd->disk->disk_name);
+ del_gendisk(dd->disk);
if (dd->disk->queue) {
- del_gendisk(dd->disk);
blk_cleanup_queue(dd->queue);
blk_mq_free_tag_set(&dd->tags);
- } else
- put_disk(dd->disk);
+ }
+ put_disk(dd->disk);
dd->disk = NULL;
dd->queue = NULL;
}