From c5e423dd2e97e7672b5f8b84ab15ccfa3ca1e70d Mon Sep 17 00:00:00 2001 From: Neel Natu Date: Fri, 23 May 2014 05:04:50 +0000 Subject: [PATCH] A Centos 6.4 guest will write 0xff to the 8259 mask register before beginning the proper ICWx initialization sequence. It assumes, probably correctly, that the boot firmware has done the 8259 initialization. Since grub-bhyve does not initialize the 8259 this write to the mask register takes a code path in which 'error' remains uninitialized (ready=0,icw_num=0). Fix this by initializing 'error' at the start of the function. --- sys/amd64/vmm/io/vatpic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/amd64/vmm/io/vatpic.c b/sys/amd64/vmm/io/vatpic.c index 298560c98e2..ee6fc84f90c 100644 --- a/sys/amd64/vmm/io/vatpic.c +++ b/sys/amd64/vmm/io/vatpic.c @@ -591,6 +591,7 @@ vatpic_write(struct vatpic *vatpic, struct atpic *atpic, bool in, int port, int error; uint8_t val; + error = 0; val = *eax; VATPIC_LOCK(vatpic);