qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] vhost-vdpa :Fix Coverity CID 1430270 / CID 1420267


From: Jason Wang
Subject: Re: [PATCH v2] vhost-vdpa :Fix Coverity CID 1430270 / CID 1420267
Date: Fri, 10 Jul 2020 17:14:33 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0


On 2020/7/10 下午2:46, Cindy Lu wrote:
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>


Acked-by: Jason Wang <jasowang@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;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]