Skip to content

Commit

Permalink
KVM: x86: prevent uninitialized variable warning in check_svme()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Paolo Bonzini <[email protected]>
Reviewed-by: David Hildenbrand <[email protected]>
Signed-off-by: Radim Krčmář <[email protected]>
  • Loading branch information
rkrcmar committed May 19, 2017
1 parent 34b0dad commit 92ceb76
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/kvm/emulate.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 92ceb76

Please sign in to comment.