Some error paths in vga_ioport_read() would return undefined values.
Always default the result to 0xff.

Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com>
---
 hw/cirrus_vga.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index a26b051..11ce212 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -2674,7 +2674,7 @@ static void cirrus_update_memory_access(CirrusVGAState *s)
 static uint32_t vga_ioport_read(void *opaque, uint32_t addr)
 {
     CirrusVGAState *s = opaque;
-    int val, index;
+    int val = 0xff, index;
 
     /* check port range access depending on color/monochrome mode */
     if ((addr >= 0x3b0 && addr <= 0x3bf && (s->msr & MSR_COLOR_EMULATION))
-- 
1.7.10.4


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

Reply via email to