Skip to content

Commit

Permalink
KVM: Silence underflow warning in avic_get_physical_id_entry()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and rkrcmar committed May 18, 2017
1 parent 55c315e commit d3e7dec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/x86/kvm/svm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1272,7 +1272,8 @@ static void init_vmcb(struct vcpu_svm *svm)

}

static u64 *avic_get_physical_id_entry(struct kvm_vcpu *vcpu, int index)
static u64 *avic_get_physical_id_entry(struct kvm_vcpu *vcpu,
unsigned int index)
{
u64 *avic_physical_id_table;
struct kvm_arch *vm_data = &vcpu->kvm->arch;
Expand Down

0 comments on commit d3e7dec

Please sign in to comment.