Skip to content

Commit

Permalink
vhost: assert the log was cleaned up
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
elmarco authored and mstsirkin committed Jul 28, 2016
1 parent 9e0bc24 commit 7b52724
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions hw/virtio/vhost.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 7b52724

Please sign in to comment.