]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
x86: Check irq_remapped instead of remapping_enabled in destroy_irq()
authorYinghai Lu <yinghai@kernel.org>
Sat, 30 Oct 2010 08:19:29 +0000 (01:19 -0700)
committerThomas Gleixner <tglx@linutronix.de>
Sat, 30 Oct 2010 08:28:31 +0000 (10:28 +0200)
Russ Anderson reported:
| There is a regression that is causing a NULL pointer dereference
| in free_irte when shutting down xpc. git bisect narrowed it down
| to git commit d585d06(intr_remap: Simplify the code further), which
| changed free_irte(). Reverse applying the patch fixes the problem.

We need to use irq_remapped() for each irq instead of checking only
intr_remapping_enabled as there might be non remapped irqs even when
remapping is enabled.

[ tglx: use cfg instead of retrieving it again. Massaged changelog ]

Reported-bisected-and-tested-by: Russ Anderson <rja@sgi.com>
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
LKML-Reference: <4CCBD511.40607@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/x86/kernel/apic/io_apic.c

index 0929191d83cf5264751fbfffd19554f78f986848..7cc0a721f628c302d0d420ba0bf3af1945d5a1c0 100644 (file)
@@ -3109,7 +3109,7 @@ void destroy_irq(unsigned int irq)
 
        irq_set_status_flags(irq, IRQ_NOREQUEST|IRQ_NOPROBE);
 
-       if (intr_remapping_enabled)
+       if (irq_remapped(cfg))
                free_irte(irq);
        raw_spin_lock_irqsave(&vector_lock, flags);
        __clear_irq_vector(irq, cfg);