summaryrefslogtreecommitdiffstats
path: root/contrib/vhost-user-input
diff options
context:
space:
mode:
authorStefan Hajnoczi2019-11-19 12:16:26 +0100
committerMichael S. Tsirkin2019-11-20 10:57:22 +0100
commitec244b17391f8f9a16e91905a91a52dd77d3759f (patch)
tree958b5a1ffbb2f61ef2f1a638f013289a0375dcf8 /contrib/vhost-user-input
parentlibvhost-user: Zero memory allocated for VuVirtqInflightDesc (diff)
downloadqemu-ec244b17391f8f9a16e91905a91a52dd77d3759f.tar.gz
qemu-ec244b17391f8f9a16e91905a91a52dd77d3759f.tar.xz
qemu-ec244b17391f8f9a16e91905a91a52dd77d3759f.zip
vhost-user-input: use free(elem) instead of g_free(elem)
The virtqueue element returned by vu_queue_pop() is allocated using malloc(3) by virtqueue_alloc_element(). Use the matching free(3) function instead of glib's g_free(). Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20191119111626.112206-1-stefanha@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Diffstat (limited to 'contrib/vhost-user-input')
-rw-r--r--contrib/vhost-user-input/main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/vhost-user-input/main.c b/contrib/vhost-user-input/main.c
index 449fd2171a..ef4b7769f2 100644
--- a/contrib/vhost-user-input/main.c
+++ b/contrib/vhost-user-input/main.c
@@ -77,7 +77,7 @@ static void vi_input_send(VuInput *vi, struct virtio_input_event *event)
len = iov_from_buf(elem->in_sg, elem->in_num,
0, &vi->queue[i].event, sizeof(virtio_input_event));
vu_queue_push(dev, vq, elem, len);
- g_free(elem);
+ free(elem);
}
vu_queue_notify(&vi->dev.parent, vq);
@@ -153,7 +153,7 @@ static void vi_handle_sts(VuDev *dev, int qidx)
0, &event, sizeof(event));
vi_handle_status(vi, &event);
vu_queue_push(dev, vq, elem, len);
- g_free(elem);
+ free(elem);
}
vu_queue_notify(&vi->dev.parent, vq);