From 0c31c16ac85918e33a8319523655dae87012a2a0 Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Sun, 4 Oct 2009 16:45:13 +0200 Subject: [PATCH] --- yaml --- r: 166923 b: refs/heads/master c: 6a54435560efdab1a08f429a954df4d6c740bddf h: refs/heads/master i: 166921: cfbe8a7728e64c8009613a3cfe9267a22975cf53 166919: e8f63e86b796e05989beb75fef2b1545fe8c142f v: v3 --- [refs] | 2 +- trunk/arch/x86/kvm/x86.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index a70cdc1be61c..2347d37766eb 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: eb5109e311b5152c0614a28d7d615d087f268f19 +refs/heads/master: 6a54435560efdab1a08f429a954df4d6c740bddf diff --git a/trunk/arch/x86/kvm/x86.c b/trunk/arch/x86/kvm/x86.c index be451ee44249..9b9695322f56 100644 --- a/trunk/arch/x86/kvm/x86.c +++ b/trunk/arch/x86/kvm/x86.c @@ -1591,6 +1591,8 @@ static int kvm_dev_ioctl_get_supported_cpuid(struct kvm_cpuid2 *cpuid, if (cpuid->nent < 1) goto out; + if (cpuid->nent > KVM_MAX_CPUID_ENTRIES) + cpuid->nent = KVM_MAX_CPUID_ENTRIES; r = -ENOMEM; cpuid_entries = vmalloc(sizeof(struct kvm_cpuid_entry2) * cpuid->nent); if (!cpuid_entries)