lkml.org 
[lkml]   [2018]   [Feb]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 1/2] KVM: x86: Add a framework for supporting MSR-based features
On Thu, Feb 08, 2018 at 04:58:46PM -0600, Tom Lendacky wrote:
> @@ -2681,11 +2731,15 @@ static int __msr_io(struct kvm_vcpu *vcpu, struct kvm_msrs *msrs,
> {
> int i, idx;
>
> - idx = srcu_read_lock(&vcpu->kvm->srcu);
> + if (vcpu)
> + idx = srcu_read_lock(&vcpu->kvm->srcu);
> +
> for (i = 0; i < msrs->nmsrs; ++i)
> if (do_msr(vcpu, entries[i].index, &entries[i].data))
> break;
> - srcu_read_unlock(&vcpu->kvm->srcu, idx);
> +
> + if (vcpu)
> + srcu_read_unlock(&vcpu->kvm->srcu, idx);


./include/linux/srcu.h:175:2: warning: ‘idx’ may be used uninitialized in this function [-Wmaybe-uninitialized]
__srcu_read_unlock(sp, idx);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/kvm/x86.c:2739:9: note: ‘idx’ was declared here
int i, idx;
^~~

I know, silly gcc.

--
Regards/Gruss,
Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

\
 
 \ /
  Last update: 2018-02-14 17:45    [W:0.176 / U:2.720 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site