Skip to content

Commit

Permalink
powerpc: Fix logic error in fixup_irqs
Browse files Browse the repository at this point in the history
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>
Cc: stable@kernel.org [2.6.32+]
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
  • Loading branch information
Johannes Berg authored and Benjamin Herrenschmidt committed Jul 8, 2010
1 parent d3005fb commit 3cd8519
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion arch/powerpc/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,10 @@ void fixup_irqs(const struct cpumask *map)

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);
Expand Down

0 comments on commit 3cd8519

Please sign in to comment.