xen: fix memory access violation bug when CONFIG_HAVE_SPARSE_IRQ is enabled
authorAlex Nixon <alex.nixon@citrix.com>
Wed, 20 Aug 2008 03:50:53 +0000 (20:50 -0700)
committerIngo Molnar <mingo@elte.hu>
Thu, 16 Oct 2008 14:52:58 +0000 (16:52 +0200)
When sparse IRQs are enabled, it is not safe to assume an IRQ descriptor
exists for every possible IRQ.  This patch causes init_evtchn_cpu_bindings
to skip initialisation of IRQ descriptors which don't exist.

Signed-off-by: Alex Nixon <alex.nixon@citrix.com>
Acked-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
drivers/xen/events.c

index 56ace47..e6d47e8 100644 (file)
@@ -141,6 +141,8 @@ static void init_evtchn_cpu_bindings(void)
        /* By default all event channels notify CPU#0. */
        for (i = 0; i < nr_irqs; i++) {
                struct irq_desc *desc = irq_to_desc(i);
+               if (!desc)
+                       continue;
                desc->affinity = cpumask_of_cpu(0);
        }
 #endif