From abd764250fbce6f285513d74f03eb5c526e520f6 Mon Sep 17 00:00:00 2001 From: Stefan Hajnoczi Date: Wed, 9 Jul 2014 10:05:47 +0200 Subject: 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 Tested-by: Christian Borntraeger Signed-off-by: Kevin Wolf --- include/hw/virtio/dataplane/vring.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/hw/virtio/dataplane/vring.h b/include/hw/virtio/dataplane/vring.h index 63e7bf4..b23edd2 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 */ -- cgit v1.1