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

[Xen-devel] [PATCH 01/32] virtio-blk: initialise unused blkcfg.size_max field



From: Yunlei Ding <yunlei.ding@xxxxxxxxxx>

Newer GCC warns about memcpy()ing uninitialised data.

Signed-off-by: Yunlei Ding <yunlei.ding@xxxxxxxxxx>
Coverity-ID: 1056088
Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 hw/virtio-blk.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c
index 520ad1b..fcf893a 100644
--- a/hw/virtio-blk.c
+++ b/hw/virtio-blk.c
@@ -252,6 +252,7 @@ static void virtio_blk_update_config(VirtIODevice *vdev, 
uint8_t *config)
     stw_raw(&blkcfg.cylinders, cylinders);
     blkcfg.heads = heads;
     blkcfg.sectors = secs;
+    blkcfg.size_max = 0;
     memcpy(config, &blkcfg, sizeof(blkcfg));
 }
 
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.