Skip to content

Commit

Permalink
xen: events: do not leak IRQ from xen_allocate_pirq_msi when no pirq …
Browse files Browse the repository at this point in the history
…available.

Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: xen-devel@lists.xensource.com
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
  • Loading branch information
Ian Campbell authored and Konrad Rzeszutek Wilk committed Mar 10, 2011
1 parent 260a7d4 commit ae1635b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/xen/events.c
Original file line number Diff line number Diff line change
Expand Up @@ -676,8 +676,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,
Expand Down

0 comments on commit ae1635b

Please sign in to comment.