diff options
author | Asai Thambi SP <asamymuthupa@micron.com> | 2015-05-11 18:48:00 -0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2015-06-16 10:24:40 -0400 |
commit | 02b48265e7437bfe153af16337b14ee74f00905f (patch) | |
tree | 570923bf4a79a4a41f44fb399f87424580a87811 /drivers/block | |
parent | 3715a5d014e1326b8e6d008dfbf05615014a067e (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>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/mtip32xx/mtip32xx.c | 13 |
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) | |||
2809 | kobject_put(kobj); | 2809 | kobject_put(kobj); |
2810 | } | 2810 | } |
2811 | del_gendisk(dd->disk); | 2811 | del_gendisk(dd->disk); |
2812 | put_disk(dd->disk); | ||
2812 | dd->disk = NULL; | 2813 | dd->disk = NULL; |
2813 | } | 2814 | } |
2814 | if (dd->queue) { | 2815 | if (dd->queue) { |
@@ -4095,13 +4096,13 @@ static int mtip_block_remove(struct driver_data *dd) | |||
4095 | dd->bdev = NULL; | 4096 | dd->bdev = NULL; |
4096 | } | 4097 | } |
4097 | if (dd->disk) { | 4098 | if (dd->disk) { |
4099 | del_gendisk(dd->disk); | ||
4098 | if (dd->disk->queue) { | 4100 | if (dd->disk->queue) { |
4099 | del_gendisk(dd->disk); | ||
4100 | blk_cleanup_queue(dd->queue); | 4101 | blk_cleanup_queue(dd->queue); |
4101 | blk_mq_free_tag_set(&dd->tags); | 4102 | blk_mq_free_tag_set(&dd->tags); |
4102 | dd->queue = NULL; | 4103 | dd->queue = NULL; |
4103 | } else | 4104 | } |
4104 | put_disk(dd->disk); | 4105 | put_disk(dd->disk); |
4105 | } | 4106 | } |
4106 | dd->disk = NULL; | 4107 | dd->disk = NULL; |
4107 | 4108 | ||
@@ -4140,12 +4141,12 @@ static int mtip_block_shutdown(struct driver_data *dd) | |||
4140 | dev_info(&dd->pdev->dev, | 4141 | dev_info(&dd->pdev->dev, |
4141 | "Shutting down %s ...\n", dd->disk->disk_name); | 4142 | "Shutting down %s ...\n", dd->disk->disk_name); |
4142 | 4143 | ||
4144 | del_gendisk(dd->disk); | ||
4143 | if (dd->disk->queue) { | 4145 | if (dd->disk->queue) { |
4144 | del_gendisk(dd->disk); | ||
4145 | blk_cleanup_queue(dd->queue); | 4146 | blk_cleanup_queue(dd->queue); |
4146 | blk_mq_free_tag_set(&dd->tags); | 4147 | blk_mq_free_tag_set(&dd->tags); |
4147 | } else | 4148 | } |
4148 | put_disk(dd->disk); | 4149 | put_disk(dd->disk); |
4149 | dd->disk = NULL; | 4150 | dd->disk = NULL; |
4150 | dd->queue = NULL; | 4151 | dd->queue = NULL; |
4151 | } | 4152 | } |