diff options
-rw-r--r-- | virt/kvm/kvm_main.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index a0aa84b5941a..4f588bc94186 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c | |||
@@ -1898,6 +1898,9 @@ static int kvm_vm_ioctl_create_vcpu(struct kvm *kvm, u32 id) | |||
1898 | int r; | 1898 | int r; |
1899 | struct kvm_vcpu *vcpu, *v; | 1899 | struct kvm_vcpu *vcpu, *v; |
1900 | 1900 | ||
1901 | if (id >= KVM_MAX_VCPUS) | ||
1902 | return -EINVAL; | ||
1903 | |||
1901 | vcpu = kvm_arch_vcpu_create(kvm, id); | 1904 | vcpu = kvm_arch_vcpu_create(kvm, id); |
1902 | if (IS_ERR(vcpu)) | 1905 | if (IS_ERR(vcpu)) |
1903 | return PTR_ERR(vcpu); | 1906 | return PTR_ERR(vcpu); |