From: Andrew Cooper Date: Tue, 4 Nov 2014 11:39:43 +0000 (+0000) Subject: cirrus_vga: default all I/O port reads to 0xff X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=c615d81a3c0fca9ca4706f6505cc032c737cf0c9;p=people%2Fliuw%2Flibxenctrl-split%2Fqemu-xen-traditional.git cirrus_vga: default all I/O port reads to 0xff Some error paths in vga_ioport_read() would return undefined values. Always default the result to 0xff. Signed-off-by: Andrew Cooper --- diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c index a26b0517..11ce212d 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))