]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
KVM: x86: prevent uninitialized variable warning in check_svme()
authorRadim Krčmář <rkrcmar@redhat.com>
Thu, 18 May 2017 17:37:32 +0000 (19:37 +0200)
committerRadim Krčmář <rkrcmar@redhat.com>
Fri, 19 May 2017 17:59:28 +0000 (19:59 +0200)
get_msr() of MSR_EFER is currently always going to succeed, but static
checker doesn't see that far.

Don't complicate stuff and just use 0 for the fallback -- it means that
the feature is not present.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
arch/x86/kvm/emulate.c

index c25cfaf584e7285c10d23ee8d9240f22b7c94628..0816ab2e8adcae2b45f83c95c51e8b95a245b07e 100644 (file)
@@ -4173,7 +4173,7 @@ static int check_dr_write(struct x86_emulate_ctxt *ctxt)
 
 static int check_svme(struct x86_emulate_ctxt *ctxt)
 {
-       u64 efer;
+       u64 efer = 0;
 
        ctxt->ops->get_msr(ctxt, MSR_EFER, &efer);