* [PATCH] kvm: fix error handling for out of range irq
@ 2012-01-18 18:07 Michael S. Tsirkin
2012-01-19 11:22 ` [PATCH] kvm: fix error handling for out of range Marcelo Tosatti
0 siblings, 1 reply; 3+ messages in thread
From: Michael S. Tsirkin @ 2012-01-18 18:07 UTC (permalink / raw)
Cc: Avi Kivity, Marcelo Tosatti, kvm, linux-kernel, Alex Williamson
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>
---
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 73bb001..0cbd8a1 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;
}
--
1.7.8.2.325.g247f9
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] kvm: fix error handling for out of range irq
2012-01-18 18:07 [PATCH] kvm: fix error handling for out of range irq Michael S. Tsirkin
@ 2012-01-19 11:22 ` Marcelo Tosatti
0 siblings, 0 replies; 3+ messages in thread
From: Marcelo Tosatti @ 2012-01-19 11:22 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: no To-header on input <""@redhat.com>, Avi Kivity,
kvm, linux-kernel, Alex Williamson
On Wed, Jan 18, 2012 at 08:07:09PM +0200, Michael S. Tsirkin wrote:
> 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>
> ---
> virt/kvm/assigned-dev.c | 4 +---
> 1 files changed, 1 insertions(+), 3 deletions(-)
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] kvm: fix error handling for out of range
@ 2012-01-19 11:22 ` Marcelo Tosatti
0 siblings, 0 replies; 3+ messages in thread
From: Marcelo Tosatti @ 2012-01-19 11:22 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: Avi Kivity, kvm, linux-kernel, Alex Williamson
On Wed, Jan 18, 2012 at 08:07:09PM +0200, Michael S. Tsirkin wrote:
> 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>
> ---
> virt/kvm/assigned-dev.c | 4 +---
> 1 files changed, 1 insertions(+), 3 deletions(-)
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-01-19 12:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-18 18:07 [PATCH] kvm: fix error handling for out of range irq Michael S. Tsirkin
2012-01-19 11:22 ` Marcelo Tosatti
2012-01-19 11:22 ` [PATCH] kvm: fix error handling for out of range Marcelo Tosatti
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.