Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1644778 > unrolled thread
| Started by | Radim Krčmář <rkrcmar@redhat.com> |
|---|---|
| First post | 2017-05-18 19:40 +0200 |
| Last post | 2017-05-19 15:40 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH 4/4] KVM: x86: prevent uninitialized variable warning in check_svme() Radim Krčmář <rkrcmar@redhat.com> - 2017-05-18 19:40 +0200
Re: [PATCH 4/4] KVM: x86: prevent uninitialized variable warning in check_svme() David Hildenbrand <david@redhat.com> - 2017-05-19 15:40 +0200
| From | Radim Krčmář <rkrcmar@redhat.com> |
|---|---|
| Date | 2017-05-18 19:40 +0200 |
| Subject | [PATCH 4/4] KVM: x86: prevent uninitialized variable warning in check_svme() |
| Message-ID | <tIxz3-5R2-1@gated-at.bofh.it> |
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
[toc] | [next] | [standalone]
| From | David Hildenbrand <david@redhat.com> |
|---|---|
| Date | 2017-05-19 15:40 +0200 |
| Subject | Re: [PATCH 4/4] KVM: x86: prevent uninitialized variable warning in check_svme() |
| Message-ID | <tIQim-2MD-13@gated-at.bofh.it> |
| In reply to | #1644778 |
On 18.05.2017 19:37, Radim Krčmář wrote:
> 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);
>
>
Reviewed-by: David Hildenbrand <david@redhat.com>
--
Thanks,
David
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web