]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
sparseirq, xen: make sure irq_desc is allocated for interrupts
authorJeremy Fitzhardinge <jeremy@goop.org>
Wed, 17 Dec 2008 21:42:29 +0000 (13:42 -0800)
committerIngo Molnar <mingo@elte.hu>
Thu, 18 Dec 2008 11:48:29 +0000 (12:48 +0100)
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>
drivers/xen/events.c

index 2924faa7f6c4c08fdbea987a7135a6f689fcc993..46625cd38743c2506e1fc024c8e1c4d434a4fa26 100644 (file)
@@ -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++)
@@ -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;
 }