aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2012-01-02 09:26:19 +0100
committerJan Beulich <jbeulich@suse.com>2012-01-02 09:26:19 +0100
commit49f9d2493cfb6fd73c4a1c5d7d89c1b3f090c3e4 (patch)
tree148b711f4ff6aa915d2bdbe1bf4c49ba365f6fd3
parentf12ee533150761df5a7099c83f2a5fa6c07d1187 (diff)
downloadxen-49f9d2493cfb6fd73c4a1c5d7d89c1b3f090c3e4.tar.gz
xen-49f9d2493cfb6fd73c4a1c5d7d89c1b3f090c3e4.tar.bz2
xen-49f9d2493cfb6fd73c4a1c5d7d89c1b3f090c3e4.zip
x86/passthrough: don't leak guest IRQs
As unmap_domain_pirq_emuirq() fails on a never mapped pIRQ, it must not be called for the non-emu-IRQ case (to prevent the entire unmap operation failing). Based on a suggestion from Stefano. Signed-off-by: Jan Beulich <jbeulich@suse.com> Tested-by: Yongjie Ren <yongjie.ren@intel.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
-rw-r--r--xen/arch/x86/physdev.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c
index ca4fb59e97..f280c28c6f 100644
--- a/xen/arch/x86/physdev.c
+++ b/xen/arch/x86/physdev.c
@@ -219,7 +219,8 @@ int physdev_unmap_pirq(domid_t domid, int pirq)
if ( is_hvm_domain(d) )
{
spin_lock(&d->event_lock);
- ret = unmap_domain_pirq_emuirq(d, pirq);
+ if ( domain_pirq_to_emuirq(d, pirq) != IRQ_UNBOUND )
+ ret = unmap_domain_pirq_emuirq(d, pirq);
spin_unlock(&d->event_lock);
if ( domid == DOMID_SELF || ret )
goto free_domain;