KVM: x86: Drop redundant array size check
authorSean Christopherson <sean.j.christopherson@intel.com>
Mon, 2 Mar 2020 23:56:20 +0000 (15:56 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 16 Mar 2020 16:58:06 +0000 (17:58 +0100)
Drop a "nent >= maxnent" check in kvm_get_cpuid() that's fully redundant
now that kvm_get_cpuid() isn't indexing the array to pass an entry to
do_cpuid_func().

Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/cpuid.c

index 59195de..4bf4f7d 100644 (file)
@@ -844,9 +844,6 @@ static int get_cpuid_func(struct kvm_cpuid_array *array, u32 func,
 
        limit = array->entries[array->nent - 1].eax;
        for (func = func + 1; func <= limit; ++func) {
-               if (array->nent >= array->maxnent)
-                       return -E2BIG;
-
                r = do_cpuid_func(array, func, type);
                if (r)
                        break;