Skip to content

Commit

Permalink
[ARM] fix drivers/mfd/ucb1x00-core.c IRQ probing bug
Browse files Browse the repository at this point in the history
While reviewing the IRQ autoprobing code i found the attached buglet.
probe_irq_on()/off() calls must always be in pairs, because the generic IRQ
code uses a global semaphore to serialize all autoprobing activites.
(which does make sense) The ARM code's probe_irq_*() implementation does
not do this, but if this driver is ever used on another platform, this bug
might bite.

(It probably does not trigger in practice, because a zero probing mask
returned should be rare - but still.)

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Ingo Molnar authored and Russell King committed Jun 26, 2006
1 parent cd701aa commit cfc7365
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/mfd/ucb1x00-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,10 @@ static int ucb1x00_detect_irq(struct ucb1x00 *ucb)
unsigned long mask;

mask = probe_irq_on();
if (!mask)
if (!mask) {
probe_irq_off(mask);
return NO_IRQ;
}

/*
* Enable the ADC interrupt.
Expand Down

0 comments on commit cfc7365

Please sign in to comment.