Re: [PATCH v2 2/2] can: virtio: fix virtqueue use before DRIVER_OK
From: Seonghyeon Lim
Date: Thu Dec 03 2026 - 06:19:40 EST
On Thu, Dec 03, 2026 at 03:35:38AM -0500, Michael S. Tsirkin wrote:
> > + virtio_device_ready(vdev);
> > +
> > virtio_can_populate_rx_vq(vdev);
> >
> > err = register_virtio_can_dev(dev);
>
> But this means device is now enabled on register failure.
> You have to reset it on failure then.
The failure path already does that: when register_virtio_can_dev()
fails, probe calls virtio_can_del_vq(), which starts with
virtio_reset_device() before deleting the virtqueues. The same goes for
restore when virtio_can_open() fails.
I can add a note about this to the commit message if you'd like.
Thanks,
Seonghyeon