diff options
author | Jan Beulich <jbeulich@suse.com> | 2012-03-07 08:19:48 +0000 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2012-03-07 08:19:48 +0000 |
commit | 3237652624cba7e6346c1e60513be3f6bd0d67f3 (patch) | |
tree | 75b083cc03e3644a60009cd11c1b5d19891b12e6 | |
parent | 6f8145eee37cdb6b4af2f33fbe80970608227dc3 (diff) | |
download | xen-3237652624cba7e6346c1e60513be3f6bd0d67f3.tar.gz xen-3237652624cba7e6346c1e60513be3f6bd0d67f3.tar.bz2 xen-3237652624cba7e6346c1e60513be3f6bd0d67f3.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>
xen-unstable changeset: 24448:3a22ed3ec534
xen-unstable date: Mon Jan 02 09:26:19 2012 +0100
-rw-r--r-- | xen/arch/x86/physdev.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c index 1b894f0e5c..40c72ee70b 100644 --- a/xen/arch/x86/physdev.c +++ b/xen/arch/x86/physdev.c @@ -233,7 +233,8 @@ static int physdev_unmap_pirq(struct physdev_unmap_pirq *unmap) if ( is_hvm_domain(d) ) { spin_lock(&d->event_lock); - ret = unmap_domain_pirq_emuirq(d, unmap->pirq); + if ( domain_pirq_to_emuirq(d, unmap->pirq) != IRQ_UNBOUND ) + ret = unmap_domain_pirq_emuirq(d, unmap->pirq); spin_unlock(&d->event_lock); if ( unmap->domid == DOMID_SELF || ret ) goto free_domain; |