diff options
author | Philippe Mathieu-Daudé <philmd@redhat.com> | 2020-10-28 16:40:04 +0100 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2020-10-30 04:29:13 -0400 |
commit | 8acb3218b98c5f1bc02597ce5985fd02da7af0b1 (patch) | |
tree | 04cd62605834e723e551a96c91f7ecd140567746 /hw | |
parent | 9390255468e33811e6791d5afef3113a40770aba (diff) | |
download | qemu-8acb3218b98c5f1bc02597ce5985fd02da7af0b1.zip qemu-8acb3218b98c5f1bc02597ce5985fd02da7af0b1.tar.gz qemu-8acb3218b98c5f1bc02597ce5985fd02da7af0b1.tar.bz2 |
hw/virtio/vhost-vdpa: Fix Coverity CID 1432864
Fix uninitialized value issues reported by Coverity:
Field 'msg.reserved' is uninitialized when calling write().
Fixes: a5bd05800f8 ("vhost-vdpa: batch updating IOTLB mappings")
Reported-by: Coverity (CID 1432864: UNINIT)
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20201028154004.776760-1-philmd@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/virtio/vhost-vdpa.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index 4f10399..01d2101 100644 --- a/hw/virtio/vhost-vdpa.c +++ b/hw/virtio/vhost-vdpa.c @@ -90,7 +90,7 @@ static void vhost_vdpa_listener_begin(MemoryListener *listener) { struct vhost_vdpa *v = container_of(listener, struct vhost_vdpa, listener); struct vhost_dev *dev = v->dev; - struct vhost_msg_v2 msg; + struct vhost_msg_v2 msg = {}; int fd = v->device_fd; if (!(dev->backend_cap & (0x1ULL << VHOST_BACKEND_F_IOTLB_BATCH))) { @@ -110,7 +110,7 @@ static void vhost_vdpa_listener_commit(MemoryListener *listener) { struct vhost_vdpa *v = container_of(listener, struct vhost_vdpa, listener); struct vhost_dev *dev = v->dev; - struct vhost_msg_v2 msg; + struct vhost_msg_v2 msg = {}; int fd = v->device_fd; if (!(dev->backend_cap & (0x1ULL << VHOST_BACKEND_F_IOTLB_BATCH))) { |