When SPARSE_IRQ is set, irq_to_desc() can
return NULL. While the code here has a
check for NULL, it's not really correct.
Fix it by separating the check for it.

This fixes CPU hot unplug for me.

Reported-by: Alastair Bridgewater <alastair.bridgewa...@gmail.com>
Cc: sta...@kernel.org [2.6.32+]
Signed-off-by: Johannes Berg <johan...@sipsolutions.net>
---
v2: cc Alastair, sorry
v3: indicate stable versions

 arch/powerpc/kernel/irq.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- wireless-testing.orig/arch/powerpc/kernel/irq.c     2010-06-11 
22:51:08.000000000 +0200
+++ wireless-testing/arch/powerpc/kernel/irq.c  2010-06-11 22:54:11.000000000 
+0200
@@ -295,7 +295,10 @@ void fixup_irqs(const struct cpumask *ma
 
        for_each_irq(irq) {
                desc = irq_to_desc(irq);
-               if (desc && desc->status & IRQ_PER_CPU)
+               if (!desc)
+                       continue;
+
+               if (desc->status & IRQ_PER_CPU)
                        continue;
 
                cpumask_and(mask, desc->affinity, map);



_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Reply via email to