Skip to content

Commit

Permalink
sparseirq, xen: make sure irq_desc is allocated for interrupts
Browse files Browse the repository at this point in the history
Impact: fix crash

Make sure all Xen irqs have an irq_desc.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Jeremy Fitzhardinge authored and Ingo Molnar committed Dec 18, 2008
1 parent 17483a1 commit 6f8a0ed
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/xen/events.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ static void unmask_evtchn(int port)
static int find_unbound_irq(void)
{
int irq;
struct irq_desc *desc;

/* Only allocate from dynirq range */
for (irq = 0; irq < nr_irqs; irq++)
Expand All @@ -242,6 +243,10 @@ static int find_unbound_irq(void)
if (irq == nr_irqs)
panic("No available IRQ to bind to: increase nr_irqs!\n");

desc = irq_to_desc_alloc_cpu(irq, 0);
if (WARN_ON(desc == NULL))
return -1;

return irq;
}

Expand Down

0 comments on commit 6f8a0ed

Please sign in to comment.