diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2011-06-11 12:23:55 +0200 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-07-12 13:16:18 +0300 |
commit | 9f3191aec595ef9f3c80bc96664fd7aef57ef5be (patch) | |
tree | 53be5ad0a1b677fa9a43bd8b2c22e1c5bad76a54 /virt | |
parent | 1dda606c5f94b14a8f36c220d1d8844bab68a720 (diff) | |
download | linux-3.10-9f3191aec595ef9f3c80bc96664fd7aef57ef5be.tar.gz linux-3.10-9f3191aec595ef9f3c80bc96664fd7aef57ef5be.tar.bz2 linux-3.10-9f3191aec595ef9f3c80bc96664fd7aef57ef5be.zip |
KVM: Fix off-by-one in overflow check of KVM_ASSIGN_SET_MSIX_NR
KVM_MAX_MSIX_PER_DEV implies that up to that many MSI-X entries can be
requested. But the kernel so far rejected already the upper limit.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'virt')
-rw-r--r-- | virt/kvm/assigned-dev.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/virt/kvm/assigned-dev.c b/virt/kvm/assigned-dev.c index 6cc4b97ec45..4e9eaeb518c 100644 --- a/virt/kvm/assigned-dev.c +++ b/virt/kvm/assigned-dev.c @@ -617,7 +617,7 @@ static int kvm_vm_ioctl_set_msix_nr(struct kvm *kvm, if (adev->entries_nr == 0) { adev->entries_nr = entry_nr->entry_nr; if (adev->entries_nr == 0 || - adev->entries_nr >= KVM_MAX_MSIX_PER_DEV) { + adev->entries_nr > KVM_MAX_MSIX_PER_DEV) { r = -EINVAL; goto msix_nr_out; } |