diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2012-01-18 22:07:09 +0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2012-03-05 16:52:43 +0400 |
commit | b93a35532767a2cf78bdbc88730d5c28aa66b941 (patch) | |
tree | 604c5c62ed765b1059735056a01c18020b0e4c26 /virt/kvm | |
parent | e2358851efbcdc34583ee11971a6e4d587ea8bf9 (diff) | |
download | linux-b93a35532767a2cf78bdbc88730d5c28aa66b941.tar.xz |
KVM: fix error handling for out of range irq
find_index_from_host_irq returns 0 on error
but callers assume < 0 on error. This should
not matter much: an out of range irq should never happen since
irq handler was registered with this irq #,
and even if it does we get a spurious msix irq in guest
and typically nothing terrible happens.
Still, better to make it consistent.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'virt/kvm')
-rw-r--r-- | virt/kvm/assigned-dev.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/virt/kvm/assigned-dev.c b/virt/kvm/assigned-dev.c index 758e3b36d4cf..ece80612b594 100644 --- a/virt/kvm/assigned-dev.c +++ b/virt/kvm/assigned-dev.c @@ -49,10 +49,8 @@ static int find_index_from_host_irq(struct kvm_assigned_dev_kernel index = i; break; } - if (index < 0) { + if (index < 0) printk(KERN_WARNING "Fail to find correlated MSI-X entry!\n"); - return 0; - } return index; } |