diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2017-05-18 03:38:53 -0400 |
---|---|---|
committer | Radim Krčmář <rkrcmar@redhat.com> | 2017-05-18 08:53:54 -0400 |
commit | d3e7dec054174fdddae33eaa0032a82c3f42181d (patch) | |
tree | 3af3c47ff972a64d9745d6801856005045060a43 | |
parent | 55c315ee09d3bd37f9d71e85e54d6ebe675b6462 (diff) |
KVM: Silence underflow warning in avic_get_physical_id_entry()
Smatch complains that we check cap the upper bound of "index" but don't
check for negatives. It's a false positive because "index" is never
negative. But it's also simple enough to make it unsigned which makes
the code easier to audit.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
-rw-r--r-- | arch/x86/kvm/svm.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index c27ac6923a18..183ddb235fb4 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
@@ -1272,7 +1272,8 @@ static void init_vmcb(struct vcpu_svm *svm) | |||
1272 | 1272 | ||
1273 | } | 1273 | } |
1274 | 1274 | ||
1275 | static u64 *avic_get_physical_id_entry(struct kvm_vcpu *vcpu, int index) | 1275 | static u64 *avic_get_physical_id_entry(struct kvm_vcpu *vcpu, |
1276 | unsigned int index) | ||
1276 | { | 1277 | { |
1277 | u64 *avic_physical_id_table; | 1278 | u64 *avic_physical_id_table; |
1278 | struct kvm_arch *vm_data = &vcpu->kvm->arch; | 1279 | struct kvm_arch *vm_data = &vcpu->kvm->arch; |