aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/virtio_blk.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 54a8017ad487..6143337527e7 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -264,12 +264,16 @@ static void virtblk_remove(struct virtio_device *vdev)
264 struct virtio_blk *vblk = vdev->priv; 264 struct virtio_blk *vblk = vdev->priv;
265 int major = vblk->disk->major; 265 int major = vblk->disk->major;
266 266
267 /* Nothing should be pending. */
267 BUG_ON(!list_empty(&vblk->reqs)); 268 BUG_ON(!list_empty(&vblk->reqs));
269
270 /* Stop all the virtqueues. */
271 vdev->config->reset(vdev);
272
268 blk_cleanup_queue(vblk->disk->queue); 273 blk_cleanup_queue(vblk->disk->queue);
269 put_disk(vblk->disk); 274 put_disk(vblk->disk);
270 unregister_blkdev(major, "virtblk"); 275 unregister_blkdev(major, "virtblk");
271 mempool_destroy(vblk->pool); 276 mempool_destroy(vblk->pool);
272 /* There should be nothing in the queue now, so no need to shutdown */
273 vdev->config->del_vq(vblk->vq); 277 vdev->config->del_vq(vblk->vq);
274 kfree(vblk); 278 kfree(vblk);
275} 279}