On 11/5/26 21:24, Stefano Garzarella wrote:
From: Stefano Garzarella <[email protected]>

vhost_dev_init() clears the struct vhost_dev in the error path calling
vhost_dev_cleanup(). So, to prevent memory leaks, we need to keep a
local reference to the vhost_virtqueue array and deallocate it in case
of failure, just as most other callers of vhost_dev_init() do.

Discovered while reviewing a patch by Alexandr Moshkov fixing the
same issue in vhost-user-fs.

Fixes: f24bb7287ddb ("Add vhost-user-backend")
Signed-off-by: Stefano Garzarella <[email protected]>
---

Reviewed-by: Alexandr Moshkov <[email protected]>


Best regards,

Alexandr


Reply via email to