diff options
Diffstat (limited to 'virt/kvm')
-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 9ed9c8c7b874..03a0381b1cb7 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c | |||
@@ -1893,6 +1893,9 @@ static int kvm_vm_ioctl_create_vcpu(struct kvm *kvm, u32 id) | |||
1893 | int r; | 1893 | int r; |
1894 | struct kvm_vcpu *vcpu, *v; | 1894 | struct kvm_vcpu *vcpu, *v; |
1895 | 1895 | ||
1896 | if (id >= KVM_MAX_VCPUS) | ||
1897 | return -EINVAL; | ||
1898 | |||
1896 | vcpu = kvm_arch_vcpu_create(kvm, id); | 1899 | vcpu = kvm_arch_vcpu_create(kvm, id); |
1897 | if (IS_ERR(vcpu)) | 1900 | if (IS_ERR(vcpu)) |
1898 | return PTR_ERR(vcpu); | 1901 | return PTR_ERR(vcpu); |