kvm: Fix irq route entries exceeding KVM_MAX_IRQ_ROUTES
[firefly-linux-kernel-4.4.55.git] / virt / kvm / kvm_main.c
index fefbf2d148efb6c1197ade46fd3f2ccca198b826..510df220d1b5d92850c7eb3f9e8d3ac0aa890a21 100644 (file)
@@ -2861,7 +2861,7 @@ static long kvm_vm_ioctl(struct file *filp,
                if (copy_from_user(&routing, argp, sizeof(routing)))
                        goto out;
                r = -EINVAL;
-               if (routing.nr >= KVM_MAX_IRQ_ROUTES)
+               if (routing.nr > KVM_MAX_IRQ_ROUTES)
                        goto out;
                if (routing.flags)
                        goto out;