aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorPrasad Pandit <pjp@fedoraproject.org>2023-05-29 17:13:33 +0530
committerMichael S. Tsirkin <mst@redhat.com>2023-06-23 02:54:44 -0400
commit77ece20ba04582d94c345ac0107ddff2fd18d27a (patch)
tree050b22dd47337feb628070a074bc43aa63d55fa3 /hw
parent1e3ffb34f764f8ac4c003b2b2e6a775b2b073a16 (diff)
downloadqemu-77ece20ba04582d94c345ac0107ddff2fd18d27a.zip
qemu-77ece20ba04582d94c345ac0107ddff2fd18d27a.tar.gz
qemu-77ece20ba04582d94c345ac0107ddff2fd18d27a.tar.bz2
vhost: release virtqueue objects in error path
vhost_dev_start function does not release virtqueue objects when event_notifier_init() function fails. Release virtqueue objects and log a message about function failure. Signed-off-by: Prasad Pandit <pjp@fedoraproject.org> Message-Id: <20230529114333.31686-3-ppandit@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Fixes: f9a09ca3ea ("vhost: add support for configure interrupt") Reviewed-by: Peter Xu <peterx@redhat.com> Cc: qemu-stable@nongnu.org Acked-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/virtio/vhost.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index 7e1f556..fb7abc9 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -1941,7 +1941,8 @@ int vhost_dev_start(struct vhost_dev *hdev, VirtIODevice *vdev, bool vrings)
r = event_notifier_init(
&hdev->vqs[VHOST_QUEUE_NUM_CONFIG_INR].masked_config_notifier, 0);
if (r < 0) {
- return r;
+ VHOST_OPS_DEBUG(r, "event_notifier_init failed");
+ goto fail_vq;
}
event_notifier_test_and_clear(
&hdev->vqs[VHOST_QUEUE_NUM_CONFIG_INR].masked_config_notifier);