[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 67/78] vhost-user-gpu: Release memory returned by vu_queue_pop()
From: |
Michael Roth |
Subject: |
[PATCH 67/78] vhost-user-gpu: Release memory returned by vu_queue_pop() with free() |
Date: |
Tue, 16 Jun 2020 09:15:36 -0500 |
From: Philippe Mathieu-Daudé <philmd@redhat.com>
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>
(cherry picked from commit 4ff97121a3ee631971aadc87e3d4e7fb66f15aa8)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
contrib/vhost-user-gpu/main.c | 4 ++--
contrib/vhost-user-gpu/virgl.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/contrib/vhost-user-gpu/main.c b/contrib/vhost-user-gpu/main.c
index b45d2019b4..a019d0a9ac 100644
--- a/contrib/vhost-user-gpu/main.c
+++ b/contrib/vhost-user-gpu/main.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.17.1
- [PATCH 58/78] qga: Installer: Wait for installation to finish, (continued)
- [PATCH 58/78] qga: Installer: Wait for installation to finish, Michael Roth, 2020/06/16
- [PATCH 59/78] qga-win: Handle VSS_E_PROVIDER_ALREADY_REGISTERED error, Michael Roth, 2020/06/16
- [PATCH 60/78] qga-win: prevent crash when executing guest-file-read with large count, Michael Roth, 2020/06/16
- [PATCH 05/78] target/arm: ensure we use current exception state after SCR update, Michael Roth, 2020/06/16
- [PATCH 61/78] qga: Fix undefined C behavior, Michael Roth, 2020/06/16
- [PATCH 62/78] qemu-ga: document vsock-listen in the man page, Michael Roth, 2020/06/16
- [PATCH 63/78] hw/i386/amd_iommu.c: Fix corruption of log events passed to guest, Michael Roth, 2020/06/16
- [PATCH 64/78] tcg/i386: Fix INDEX_op_dup2_vec, Michael Roth, 2020/06/16
- [PATCH 65/78] dump: Fix writing of ELF section, Michael Roth, 2020/06/16
- [PATCH 66/78] xen-block: Fix double qlist remove and request leak, Michael Roth, 2020/06/16
- [PATCH 67/78] vhost-user-gpu: Release memory returned by vu_queue_pop() with free(),
Michael Roth <=
- [PATCH 68/78] target/ppc: Fix mtmsr(d) L=1 variant that loses interrupts, Michael Roth, 2020/06/16
- [PATCH 69/78] hostmem: don't use mbind() if host-nodes is empty, Michael Roth, 2020/06/16
- [PATCH 70/78] target/arm: Clear tail in gvec_fmul_idx_*, gvec_fmla_idx_*, Michael Roth, 2020/06/16
- [PATCH 06/78] block: Activate recursively even for already active nodes, Michael Roth, 2020/06/16
- [PATCH 71/78] qemu-nbd: Close inherited stderr, Michael Roth, 2020/06/16
- [PATCH 72/78] 9p: Lock directory streams with a CoMutex, Michael Roth, 2020/06/16