Skip to content

Commit

Permalink
KVM: fix error handling for out of range irq
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mstsirkin authored and avikivity committed Mar 5, 2012
1 parent e235885 commit b93a355
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions virt/kvm/assigned-dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit b93a355

Please sign in to comment.