All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vhost-user-input: use free(elem) instead of g_free(elem)
@ 2019-11-19 11:16 Stefan Hajnoczi
  2019-11-19 11:52 ` Marc-André Lureau
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Stefan Hajnoczi @ 2019-11-19 11:16 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann, Stefan Hajnoczi, Michael S. Tsirkin

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>
---
 contrib/vhost-user-input/main.c | 4 ++--
 1 file 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);
-- 
2.23.0



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-11-21 13:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-19 11:16 [PATCH] vhost-user-input: use free(elem) instead of g_free(elem) Stefan Hajnoczi
2019-11-19 11:52 ` Marc-André Lureau
2019-11-20  9:37 ` Philippe Mathieu-Daudé
2019-11-20 11:41   ` Stefan Hajnoczi
2019-11-20 12:04     ` Michael S. Tsirkin
2019-11-20 11:48 ` Daniel P. Berrangé
2019-11-21 13:51   ` Stefan Hajnoczi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.