diff options
author | Stefan Hajnoczi | 2014-07-09 10:05:47 +0200 |
---|---|---|
committer | Kevin Wolf | 2014-07-14 12:03:20 +0200 |
commit | abd764250fbce6f285513d74f03eb5c526e520f6 (patch) | |
tree | f782045c780ae30049bef65a2e0c819ceaf8aaa1 /include/hw | |
parent | virtio-blk: avoid dataplane VirtIOBlockReq early free (diff) | |
download | qemu-abd764250fbce6f285513d74f03eb5c526e520f6.tar.gz qemu-abd764250fbce6f285513d74f03eb5c526e520f6.tar.xz qemu-abd764250fbce6f285513d74f03eb5c526e520f6.zip |
dataplane: do not free VirtQueueElement in vring_push()
VirtQueueElement is allocated in vring_pop() so it seems to make sense
that vring_push() should free it. Alas, virtio-blk frees
VirtQueueElement itself in virtio_blk_free_request().
This patch solves a double-free assertion in glib's g_slice_free().
Rename vring_free_element() to vring_unmap_element() since it no longer
frees the VirtQueueElement.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'include/hw')
-rw-r--r-- | include/hw/virtio/dataplane/vring.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/include/hw/virtio/dataplane/vring.h b/include/hw/virtio/dataplane/vring.h index 63e7bf4256..b23edd276b 100644 --- a/include/hw/virtio/dataplane/vring.h +++ b/include/hw/virtio/dataplane/vring.h @@ -55,6 +55,5 @@ bool vring_enable_notification(VirtIODevice *vdev, Vring *vring); bool vring_should_notify(VirtIODevice *vdev, Vring *vring); int vring_pop(VirtIODevice *vdev, Vring *vring, VirtQueueElement **elem); void vring_push(Vring *vring, VirtQueueElement *elem, int len); -void vring_free_element(VirtQueueElement *elem); #endif /* VRING_H */ |