public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] KVM: x86: Fix a typo about the usage of kvcalloc()
@ 2022-11-03  1:17 Liao Chang
  2022-11-03  2:37 ` Bagas Sanjaya
  2022-11-03 13:39 ` Paolo Bonzini
  0 siblings, 2 replies; 6+ messages in thread
From: Liao Chang @ 2022-11-03  1:17 UTC (permalink / raw)
  To: seanjc, pbonzini, tglx, mingo, bp, dave.hansen, hpa
  Cc: x86, kvm, linux-kernel, liaochang1

Swap the 1st and 2nd arguments to be consistent with the usage of
kvcalloc().

Fixes: c9b8fecddb5b ("KVM: use kvcalloc for array allocations")
Signed-off-by: Liao Chang <liaochang1@huawei.com>
---
 arch/x86/kvm/cpuid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
index 7065462378e2..b33c18b142c2 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -1331,7 +1331,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;
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-11-04  4:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-03  1:17 [PATCH 2/2] KVM: x86: Fix a typo about the usage of kvcalloc() Liao Chang
2022-11-03  2:37 ` Bagas Sanjaya
2022-11-03  4:18   ` liaochang (A)
2022-11-03  5:21     ` Joe Perches
2022-11-03 13:39 ` Paolo Bonzini
2022-11-04  4:06   ` liaochang (A)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox