[PATCH] virtio_blk: stop all virtqueues when 'virtblk_probe' fails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux