Skip to contentSkip to conversation

vhost: fix the fd leak

PATCH Superseded Li Feng 1 participant 1 message Jul 24, 2023

v1 of 8 Superseded Latest is v8 →

lore
Share & tools
lore

Li Feng

author
#0 lore raw

PATCH 1/1 vhost: fix the fd leak

When the vhost-user reconnect to the backend, the notifer should be cleanup. Otherwise, the fd resource will be exhausted.

Fixes f9a09ca3ea ("vhost: add support for configure interrupt")
---
 hw/virtio/vhost.c | 2 ++
 1 file changed, 2 insertions(+)
hw/virtio/vhost.c +2 -0
index abf0d03c8d..e2f6ffb446 100644
@@ -2044,6 +2044,8 @@ void vhost_dev_stop(struct vhost_dev *hdev, VirtIODevice *vdev, bool vrings)
     event_notifier_test_and_clear(
         &hdev->vqs[VHOST_QUEUE_NUM_CONFIG_INR].masked_config_notifier);
     event_notifier_test_and_clear(&vdev->config_notifier);
+    event_notifier_cleanup(
+        &hdev->vqs[VHOST_QUEUE_NUM_CONFIG_INR].masked_config_notifier);
 
     trace_vhost_dev_stop(hdev, vdev->name, vrings);
 
Signature · 1 line
2.41.0