summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2016-07-27 01:15:00 +0400
committerMichael S. Tsirkin <mst@redhat.com>2016-07-29 00:33:46 +0300
commit7b527247f09740920d8bc8aaa5ef4445256ca478 (patch)
tree5f1c3cd14f1a6125e67769d71aca6f06166ec9f1
parent9e0bc24fa57b98561d75ab8f61a419f2d69ec6aa (diff)
downloadqemu-7b527247f09740920d8bc8aaa5ef4445256ca478.tar.gz
vhost: assert the log was cleaned up
Make sure the log was released on cleanup, or it will leak (the alternative is to call vhost_log_put() unconditionally, but it may hide some dev state issues). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r--hw/virtio/vhost.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index 9bac1636c5..8a18f9b669 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -1134,6 +1134,7 @@ void vhost_dev_cleanup(struct vhost_dev *hdev)
g_free(hdev->mem);
g_free(hdev->mem_sections);
hdev->vhost_ops->vhost_backend_cleanup(hdev);
+ assert(!hdev->log);
QLIST_REMOVE(hdev, entry);
}