diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2016-07-27 01:15:00 +0400 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2016-07-29 00:33:46 +0300 |
commit | 7b527247f09740920d8bc8aaa5ef4445256ca478 (patch) | |
tree | 5f1c3cd14f1a6125e67769d71aca6f06166ec9f1 | |
parent | 9e0bc24fa57b98561d75ab8f61a419f2d69ec6aa (diff) |
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.c | 1 |
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); } |