diff mbox series

virtio_blk: stop all virtqueues when 'virtblk_probe' fails

Message ID 20240709075053.811-1-lixianming.19951001@bytedance.com (mailing list archive)
State New, archived
Headers show
Series virtio_blk: stop all virtqueues when 'virtblk_probe' fails | expand

Commit Message

lixianming.19951001 July 9, 2024, 7:50 a.m. UTC
From: lixianming <lixianming.19951001@bytedance.com>

We have already enabled the queue in 'init_vq',
so we should stop all the virtqueues, just as
we do in 'virtblk_remove', when 'virtblk_probe'
fails

Signed-off-by: lixianming <lixianming.19951001@bytedance.com>
---
 drivers/block/virtio_blk.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 2351f411fa46..fb702be291c2 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -1559,6 +1559,8 @@  static int virtblk_probe(struct virtio_device *vdev)
 out_free_tags:
 	blk_mq_free_tag_set(&vblk->tag_set);
 out_free_vq:
+	virtio_reset_device(vdev);
+	vblk->vdev = NULL;
 	vdev->config->del_vqs(vdev);
 	kfree(vblk->vqs);
 out_free_vblk: