2011-05-09 05:47:30

by Connor Hansen

[permalink] [raw]
Subject: [PATCH] kvm/emulate.c warnings

$ make allmodconfig
$ make
.....
arch/x86/kvm/emulate.c: In function 'emulate_sysexit':
arch/x86/kvm/emulate.c:1706: warning: 'cs_sel' may be used
uninitialized in this function
arch/x86/kvm/emulate.c:1706: warning: 'ss_sel' may be used
uninitialized in this function
......


patch to fix warnings.

--- a/arch/x86/kvm/emulate.c ? ?2011-05-03 23:28:18.000000000 +0000
+++ b/arch/x86/kvm/emulate.c ? ?2011-05-08 21:07:19.000000000 +0000
@@ -1703,7 +1703,7 @@
? ? ? ?struct desc_struct cs, ss;
? ? ? ?u64 msr_data;
? ? ? ?int usermode;
- ? ? ? u16 cs_sel, ss_sel;
+ ? ? ? u16 cs_sel=0, ss_sel=0;

? ? ? ?/* inject #GP if in real mode or Virtual 8086 mode */
? ? ? ?if (ctxt->mode == X86EMUL_MODE_REAL ||