sparseirq, xen: make sure irq_desc is allocated for interrupts
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>
This commit is contained in:
committed by
Ingo Molnar
parent
17483a1f34
commit
6f8a0ed4e5
@@ -233,6 +233,7 @@ static void unmask_evtchn(int port)
|
|||||||
static int find_unbound_irq(void)
|
static int find_unbound_irq(void)
|
||||||
{
|
{
|
||||||
int irq;
|
int irq;
|
||||||
|
struct irq_desc *desc;
|
||||||
|
|
||||||
/* Only allocate from dynirq range */
|
/* Only allocate from dynirq range */
|
||||||
for (irq = 0; irq < nr_irqs; irq++)
|
for (irq = 0; irq < nr_irqs; irq++)
|
||||||
@@ -242,6 +243,10 @@ static int find_unbound_irq(void)
|
|||||||
if (irq == nr_irqs)
|
if (irq == nr_irqs)
|
||||||
panic("No available IRQ to bind to: increase nr_irqs!\n");
|
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;
|
return irq;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user