]> git.baikalelectronics.ru Git - kernel.git/commitdiff
KVM: x86: Fix a typo about the usage of kvcalloc()
authorLiao Chang <liaochang1@huawei.com>
Thu, 3 Nov 2022 01:17:49 +0000 (09:17 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 3 Nov 2022 13:39:29 +0000 (09:39 -0400)
Swap the 1st and 2nd arguments to be consistent with the usage of
kvcalloc().

Fixes: b03667807801 ("KVM: use kvcalloc for array allocations")
Signed-off-by: Liao Chang <liaochang1@huawei.com>
Message-Id: <20221103011749.139262-1-liaochang1@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/cpuid.c

index 0810e93cbedc0e9cbe5c032d9b2f0f39b0bb3d63..62bc7a01ceccaa7d533be22b88e5a896c136f09b 100644 (file)
@@ -1338,7 +1338,7 @@ int kvm_dev_ioctl_get_cpuid(struct kvm_cpuid2 *cpuid,
        if (sanity_check_entries(entries, cpuid->nent, type))
                return -EINVAL;
 
-       array.entries = kvcalloc(sizeof(struct kvm_cpuid_entry2), cpuid->nent, GFP_KERNEL);
+       array.entries = kvcalloc(cpuid->nent, sizeof(struct kvm_cpuid_entry2), GFP_KERNEL);
        if (!array.entries)
                return -ENOMEM;