KVM: fix error handling for out of range irq
authorMichael S. Tsirkin <mst@redhat.com>
Wed, 18 Jan 2012 18:07:09 +0000 (20:07 +0200)
committerAvi Kivity <avi@redhat.com>
Mon, 5 Mar 2012 12:52:43 +0000 (14:52 +0200)
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>
virt/kvm/assigned-dev.c

index 758e3b36d4cfd525846a1968987d80bea8e4bcce..ece80612b594f5cfb2d83de3b720426b05a9204b 100644 (file)
@@ -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;
 }