On Mon, Nov 09, 2026 at 11:24:01AM +0500, Alexandr Moshkov wrote:
On failure, vhost_dev_init() clears vhost_dev, so the error path frees
NULL instead of the virtqueue array. Keep the pointer in the existing
vhost_vqs field and use it to free the array on failure and unrealize.

Fixes: 98fc1ada4cf7 ("virtio: add vhost-user-fs base device")
Signed-off-by: Alexandr Moshkov <[email protected]>
---
v1 -> v2:
- use the existing VHostUserFS.vhost_vqs field in realize and unrealize
  instead of local vars.

hw/virtio/vhost-user-fs.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

Reviewed-by: Stefano Garzarella <[email protected]>


Reply via email to