Re: [PATCH v2 2/2] can: virtio: fix virtqueue use before DRIVER_OK
From: Michael S. Tsirkin
Date: Thu Dec 03 2026 - 06:35:40 EST
On Thu, Dec 03, 2026 at 08:19:27PM +0900, Seonghyeon Lim wrote:
> 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
Ah, right. No, no need I think.
--
MST