On 9/7/26 5:56 PM, Stefano Garzarella wrote: > On Thu, Aug 20, 2026 at 02:39:52PM +0300, Andrey Drobyshev wrote: >> A device which only went through vhost_dev_init_backend() has its VQs >> not yet initialized, so vq->dev is NULL and vhost_virtqueue_cleanup() >> would crash dereferencing it. Check vq->dev before use, so that >> vhost_dev_cleanup() can be called to release a device whose full >> vhost_dev_init() never ran or failed along the way. > > Is this a fix for a current issue, a defensive programming measure, or > something that might happen with future patches? > > Stefano It's the latter. IIUC right now there's no way to reach the cleanup code with vq->dev uninitialized, but after a subsequent patch this becomes a possibility. I'll add this note to commit message.
Andrey
