qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

vhost-user-gpu: Release memory returned by vu_queue_pop() with free()

vu_queue_pop() returns memory that must be freed with free().

Cc: qemu-stable@nongnu.org
Reported-by: Coverity (CID 1421887 ALLOC_FREE_MISMATCH)
Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

authored by

Philippe Mathieu-Daudé and committed by
Peter Maydell
4ff97121 6329df5b

+3 -3
+2 -2
contrib/vhost-user-gpu/vhost-user-gpu.c
··· 848 848 QTAILQ_INSERT_TAIL(&vg->fenceq, cmd, next); 849 849 vg->inflight++; 850 850 } else { 851 - g_free(cmd); 851 + free(cmd); 852 852 } 853 853 } 854 854 } ··· 939 939 } 940 940 vu_queue_push(dev, vq, elem, 0); 941 941 vu_queue_notify(dev, vq); 942 - g_free(elem); 942 + free(elem); 943 943 } 944 944 } 945 945
+1 -1
contrib/vhost-user-gpu/virgl.c
··· 519 519 g_debug("FENCE %" PRIu64, cmd->cmd_hdr.fence_id); 520 520 vg_ctrl_response_nodata(g, cmd, VIRTIO_GPU_RESP_OK_NODATA); 521 521 QTAILQ_REMOVE(&g->fenceq, cmd, next); 522 - g_free(cmd); 522 + free(cmd); 523 523 g->inflight--; 524 524 } 525 525 }