[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH-for-5.0 05/12] vhost-user-gpu: Release memory returned by vu_queu
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH-for-5.0 05/12] vhost-user-gpu: Release memory returned by vu_queue_pop() with free() |
Date: |
Tue, 14 Apr 2020 15:30:45 +0200 |
vu_queue_pop() returns memory that must be freed with free().
Cc: address@hidden
Reported-by: Coverity (CID 1421887 ALLOC_FREE_MISMATCH)
Suggested-by: Peter Maydell <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
contrib/vhost-user-gpu/vhost-user-gpu.c | 4 ++--
contrib/vhost-user-gpu/virgl.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/contrib/vhost-user-gpu/vhost-user-gpu.c
b/contrib/vhost-user-gpu/vhost-user-gpu.c
index b45d2019b4..a019d0a9ac 100644
--- a/contrib/vhost-user-gpu/vhost-user-gpu.c
+++ b/contrib/vhost-user-gpu/vhost-user-gpu.c
@@ -848,7 +848,7 @@ vg_handle_ctrl(VuDev *dev, int qidx)
QTAILQ_INSERT_TAIL(&vg->fenceq, cmd, next);
vg->inflight++;
} else {
- g_free(cmd);
+ free(cmd);
}
}
}
@@ -939,7 +939,7 @@ vg_handle_cursor(VuDev *dev, int qidx)
}
vu_queue_push(dev, vq, elem, 0);
vu_queue_notify(dev, vq);
- g_free(elem);
+ free(elem);
}
}
diff --git a/contrib/vhost-user-gpu/virgl.c b/contrib/vhost-user-gpu/virgl.c
index 43413e29df..b0bc22c3c1 100644
--- a/contrib/vhost-user-gpu/virgl.c
+++ b/contrib/vhost-user-gpu/virgl.c
@@ -519,7 +519,7 @@ virgl_write_fence(void *opaque, uint32_t fence)
g_debug("FENCE %" PRIu64, cmd->cmd_hdr.fence_id);
vg_ctrl_response_nodata(g, cmd, VIRTIO_GPU_RESP_OK_NODATA);
QTAILQ_REMOVE(&g->fenceq, cmd, next);
- g_free(cmd);
+ free(cmd);
g->inflight--;
}
}
--
2.21.1
- [PATCH-for-5.0 09/12] hw/display/sm501: Avoid heap overflow in sm501_2d_operation(), (continued)
- [PATCH-for-5.0 09/12] hw/display/sm501: Avoid heap overflow in sm501_2d_operation(), Philippe Mathieu-Daudé, 2020/04/14
- [PATCH-for-5.0 02/12] qga: Extract guest_file_handle_find() to commands-common.h, Philippe Mathieu-Daudé, 2020/04/14
- [PATCH-for-5.0 01/12] Revert "prevent crash when executing guest-file-read with large count", Philippe Mathieu-Daudé, 2020/04/14
- [PATCH-for-5.0 06/12] hw/openrisc/pic_cpu: Use qdev gpio rather than qemu_allocate_irqs(), Philippe Mathieu-Daudé, 2020/04/14
- [PATCH-for-5.0 08/12] hw/misc/grlib_ahb_apb_pnp: Fix AHB PnP 8-bit accesses, Philippe Mathieu-Daudé, 2020/04/14
- [PATCH-for-5.0 10/12] hw/block/pflash: Check return value of blk_pwrite(), Philippe Mathieu-Daudé, 2020/04/14
- [PATCH-for-5.0 03/12] qga: Extract qmp_guest_file_read() to common commands.c, Philippe Mathieu-Daudé, 2020/04/14
- [PATCH-for-5.0 07/12] hw/misc/grlib_ahb_apb_pnp: Avoid crash when writing to AHB PnP registers, Philippe Mathieu-Daudé, 2020/04/14
- [PATCH-for-5.0 05/12] vhost-user-gpu: Release memory returned by vu_queue_pop() with free(),
Philippe Mathieu-Daudé <=
- [PATCH-for-5.0 12/12] gdbstub: Introduce gdb_get_freg32() to get float32 registers, Philippe Mathieu-Daudé, 2020/04/14
- Re: [PATCH-for-5.0 00/12] various bugfixes, Michael S. Tsirkin, 2020/04/17