[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 02/12] xen: events: do not leak IRQ from xen_allocate_pirq_msi when no pirq available.



Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Cc: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
---
 drivers/xen/events.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index c536157..41a8a65 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -666,8 +666,11 @@ void xen_allocate_pirq_msi(char *name, int *irq, int 
*pirq, int alloc)
 
        if (alloc & XEN_ALLOC_PIRQ) {
                *pirq = find_unbound_pirq(MAP_PIRQ_TYPE_MSI);
-               if (*pirq == -1)
+               if (*pirq == -1) {
+                       xen_free_irq(*irq);
+                       *irq = -1;
                        goto out;
+               }
        }
 
        set_irq_chip_and_handler_name(*irq, &xen_pirq_chip,
-- 
1.5.6.5


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.