* [PATCH] vhost-vdpa :Fix Coverity CID 1430270 / CID 1420267
@ 2020-07-10 6:41 Cindy Lu
0 siblings, 0 replies; only message in thread
From: Cindy Lu @ 2020-07-10 6:41 UTC (permalink / raw)
To: mst, peter.maydell, jasowang
Cc: mhabets, qemu-devel, rob.miller, saugatm, lulu, hanand, hch,
eperezma, jgg, shahafs, kevin.tian, parav, vmireyno,
cunming.liang, gdawar, jiri, xiao.w.wang, stefanha, zhihong.wang,
ian, aadam, rdunlap, maxime.coquelin, lingshan.zhu
In the function鑱絭host_vdpa_dma_map/unmap, The鑱絪truct msg鑱絯as not鑱絠nitialized all its fields.
Signed-off-by: Cindy Lu <lulu@redhat.com>
---
hw/virtio/vhost-vdpa.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
index a3d17fe0f9..b9265f3761 100644
--- a/hw/virtio/vhost-vdpa.c
+++ b/hw/virtio/vhost-vdpa.c
@@ -38,7 +38,7 @@ static bool vhost_vdpa_listener_skipped_section(MemoryRegionSection *section)
static int vhost_vdpa_dma_map(struct vhost_vdpa *v, hwaddr iova, hwaddr size,
void *vaddr, bool readonly)
{
- struct vhost_msg_v2 msg;
+ struct vhost_msg_v2 msg = {};
int fd = v->device_fd;
int ret = 0;
@@ -61,7 +61,7 @@ static int vhost_vdpa_dma_map(struct vhost_vdpa *v, hwaddr iova, hwaddr size,
static int vhost_vdpa_dma_unmap(struct vhost_vdpa *v, hwaddr iova,
hwaddr size)
{
- struct vhost_msg_v2 msg;
+ struct vhost_msg_v2 msg = {};
int fd = v->device_fd;
int ret = 0;
--
2.21.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2020-07-10 6:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-10 6:41 [PATCH] vhost-vdpa :Fix Coverity CID 1430270 / CID 1420267 Cindy Lu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).