Skip to content

Commit ec244b1

Browse files
stefanhaRHmstsirkin
authored andcommitted
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 <[email protected]> Message-Id: <[email protected]> Reviewed-by: Michael S. Tsirkin <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]> Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
1 parent d9b3ade commit ec244b1

File tree

1 file changed

+2
-2
lines changed
  • contrib/vhost-user-input

1 file changed

+2
-2
lines changed

contrib/vhost-user-input/main.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ static void vi_input_send(VuInput *vi, struct virtio_input_event *event)
7777
len = iov_from_buf(elem->in_sg, elem->in_num,
7878
0, &vi->queue[i].event, sizeof(virtio_input_event));
7979
vu_queue_push(dev, vq, elem, len);
80-
g_free(elem);
80+
free(elem);
8181
}
8282

8383
vu_queue_notify(&vi->dev.parent, vq);
@@ -153,7 +153,7 @@ static void vi_handle_sts(VuDev *dev, int qidx)
153153
0, &event, sizeof(event));
154154
vi_handle_status(vi, &event);
155155
vu_queue_push(dev, vq, elem, len);
156-
g_free(elem);
156+
free(elem);
157157
}
158158

159159
vu_queue_notify(&vi->dev.parent, vq);

0 commit comments

Comments
 (0)