]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
powerpc: Fix logic error in fixup_irqs
authorJohannes Berg <johannes@sipsolutions.net>
Wed, 16 Jun 2010 00:09:35 +0000 (00:09 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 2 Aug 2010 17:26:39 +0000 (10:26 -0700)
commit 3cd8519248e9e17d982c6fab0f1a89bca6feb49a upstream.

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.bridgewater@gmail.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/powerpc/kernel/irq.c

index dee83b82487fbe378132d99638226e20af6e5dcb..11b300a1e6ce450c2e3d46a08de397244608b1f8 100644 (file)
@@ -247,7 +247,10 @@ void fixup_irqs(cpumask_t map)
                cpumask_t mask;
 
                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);