[PATCH] virtio_blk: stop all virtqueues when 'virtblk_probe' fails
From: lixianming.19951001
Date: Tue Jul 09 2024 - 03:51:36 EST
From: lixianming <lixianming.19951001@xxxxxxxxxxxxx>
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@xxxxxxxxxxxxx>
---
drivers/block/virtio_blk.c | 2 ++
1 file changed, 2 insertions(+)
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:
--
2.20.1