Skip to content

Commit b93a355

Browse files
mstsirkinavikivity
authored andcommitted
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>
1 parent e235885 commit b93a355

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

‎virt/kvm/assigned-dev.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,8 @@ static int find_index_from_host_irq(struct kvm_assigned_dev_kernel
4949
index = i;
5050
break;
5151
}
52-
if (index < 0) {
52+
if (index < 0)
5353
printk(KERN_WARNING "Fail to find correlated MSI-X entry!\n");
54-
return 0;
55-
}
5654

5755
return index;
5856
}

0 commit comments

Comments
 (0)