diff options
author | Radim Krčmář <rkrcmar@redhat.com> | 2017-05-18 19:37:32 +0200 |
---|---|---|
committer | Radim Krčmář <rkrcmar@redhat.com> | 2017-05-19 19:59:28 +0200 |
commit | 92ceb7679ab8807d3b7fbcc6daf2279036954ef5 (patch) | |
tree | d10ea8fb176db01eb15a7d41778f68d350358c5c /arch | |
parent | KVM: x86/vPMU: fix undefined shift in intel_pmu_refresh() (diff) | |
download | linux-92ceb7679ab8807d3b7fbcc6daf2279036954ef5.tar.xz linux-92ceb7679ab8807d3b7fbcc6daf2279036954ef5.zip |
KVM: x86: prevent uninitialized variable warning in check_svme()
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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kvm/emulate.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index c25cfaf584e7..0816ab2e8adc 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -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); |