From f4f6e9a9cb349003d333f0776de94f12ac95b8d2 Mon Sep 17 00:00:00 2001 From: Yuho Choi Date: Tue, 22 Sep 2026 17:11:41 -0400 Subject: [PATCH] virtio_blk: Reset device on probe error paths after DRIVER_OK virtblk_probe() marks the device ready before revalidating zones and adding the disk, and either of those can fail. The out_cleanup_disk path they take goes on to delete the virtqueues, but nothing tells the device to stop first, so it is still live when the rings are freed. Reset the device at out_cleanup_disk, which is only reachable after virtio_device_ready(). virtblk_remove() and virtblk_freeze_priv() both reset before deleting the virtqueues for the same reason. Fixes: dbb301f91fc8 ("virtio_blk: add error handling support for add_disk()") Signed-off-by: Yuho Choi Reviewed-by: Stefan Hajnoczi Signed-off-by: Michael S. Tsirkin Message-ID: <20260922211207.523999-1-oss.patchbox@gmail.com> --- drivers/block/virtio_blk.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 603bf92de5ba..ddbb05d3e98c 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -1590,6 +1590,7 @@ static int virtblk_probe(struct virtio_device *vdev) return 0; out_cleanup_disk: + virtio_reset_device(vdev); put_disk(vblk->disk); out_free_tags: blk_mq_free_tag_set(&vblk->tag_set);