public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Radim Krčmář" <rkrcmar@redhat.com>
To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Dan Carpenter <dan.carpenter@oracle.com>
Subject: [PATCH 4/4] KVM: x86: prevent uninitialized variable warning in check_svme()
Date: Thu, 18 May 2017 19:37:32 +0200	[thread overview]
Message-ID: <20170518173732.12185-5-rkrcmar@redhat.com> (raw)
In-Reply-To: <20170518173732.12185-1-rkrcmar@redhat.com>

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>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
---
 arch/x86/kvm/emulate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);
 
-- 
2.13.0

  parent reply	other threads:[~2017-05-18 17:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-18 17:37 [PATCH 0/4] KVM: x86: fix bugs reported by Dan Carpenter Radim Krčmář
2017-05-18 17:37 ` [PATCH 1/4] KVM: nVMX: fix nested_vmx_check_vmptr failure paths under debugging Radim Krčmář
2017-05-19 13:48   ` [PATCH v2] " Radim Krčmář
2017-05-30 14:34     ` Paolo Bonzini
2017-05-18 17:37 ` [PATCH 2/4] KVM: x86: zero base3 of unusable segments Radim Krčmář
2017-05-19 13:30   ` David Hildenbrand
2017-05-18 17:37 ` [PATCH 3/4] KVM: x86/vPMU: fix undefined shift in intel_pmu_refresh() Radim Krčmář
2017-05-19 13:31   ` David Hildenbrand
2017-05-18 17:37 ` Radim Krčmář [this message]
2017-05-19 13:32   ` [PATCH 4/4] KVM: x86: prevent uninitialized variable warning in check_svme() David Hildenbrand
2017-05-18 18:52 ` [PATCH 0/4] KVM: x86: fix bugs reported by Dan Carpenter Paolo Bonzini
2017-05-18 19:25   ` Radim Krčmář

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170518173732.12185-5-rkrcmar@redhat.com \
    --to=rkrcmar@redhat.com \
    --cc=dan.carpenter@oracle.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox