[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 6/7] vhost-vdpa :Fix Coverity CID 1430270 / CID 1420267
From: |
Michael S. Tsirkin |
Subject: |
[PULL 6/7] vhost-vdpa :Fix Coverity CID 1430270 / CID 1420267 |
Date: |
Mon, 27 Jul 2020 09:49:51 -0400 |
From: Cindy Lu <lulu@redhat.com>
In the function vhost_vdpa_dma_map/unmap, The struct msg was not initialized
all its fields.
Signed-off-by: Cindy Lu <lulu@redhat.com>
Message-Id: <20200710064642.24505-1-lulu@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Cc: qemu-stable@nongnu.org
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@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 65d5aaf08a..4580f3efd8 100644
--- a/hw/virtio/vhost-vdpa.c
+++ b/hw/virtio/vhost-vdpa.c
@@ -37,7 +37,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;
@@ -60,7 +60,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;
--
MST
- [PULL 0/7] virtio,pci: bugfixes, Michael S. Tsirkin, 2020/07/27
- [PULL 1/7] virtio-mem-pci: force virtio version 1, Michael S. Tsirkin, 2020/07/27
- [PULL 2/7] hw/pci-host: save/restore pci host config register, Michael S. Tsirkin, 2020/07/27
- [PULL 3/7] hw/pci-host: save/restore pci host config register for old ones, Michael S. Tsirkin, 2020/07/27
- [PULL 4/7] Fix vhost-user buffer over-read on ram hot-unplug, Michael S. Tsirkin, 2020/07/27
- [PULL 5/7] libvhost-user: Report descriptor index on panic, Michael S. Tsirkin, 2020/07/27
- [PULL 6/7] vhost-vdpa :Fix Coverity CID 1430270 / CID 1420267,
Michael S. Tsirkin <=
- [PULL 7/7] MAINTAINERS: Cover the firmware JSON schema, Michael S. Tsirkin, 2020/07/27