Skip to content

Commit 08ece35

Browse files
committed
MIPS/ath25: Fix race in installing chained IRQ handler
Fix a race where a pending interrupt could be received and the handler called before the handler's data has been setup, by converting to irq_set_chained_handler_and_data(). Search and conversion was done with coccinelle: @@ expression E1, E2, E3; @@ ( -if (irq_set_chained_handler(E1, E3) != 0) - BUG(); | -irq_set_chained_handler(E1, E3); ) -irq_set_handler_data(E1, E2); +irq_set_chained_handler_and_data(E1, E3, E2); @@ expression E1, E2, E3; @@ ( -if (irq_set_chained_handler(E1, E3) != 0) - BUG(); ... | -irq_set_chained_handler(E1, E3); ... ) -irq_set_handler_data(E1, E2); +irq_set_chained_handler_and_data(E1, E3, E2); Reported-by: Russell King <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Cc: Julia Lawall <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Sergey Ryazanov <[email protected]> Cc: [email protected]
1 parent 20f83e7 commit 08ece35

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/mips/ath25/ar5312.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ void __init ar5312_arch_init_irq(void)
156156
irq = irq_create_mapping(domain, AR5312_MISC_IRQ_AHB_PROC);
157157
setup_irq(irq, &ar5312_ahb_err_interrupt);
158158

159-
irq_set_chained_handler(AR5312_IRQ_MISC, ar5312_misc_irq_handler);
160-
irq_set_handler_data(AR5312_IRQ_MISC, domain);
159+
irq_set_chained_handler_and_data(AR5312_IRQ_MISC,
160+
ar5312_misc_irq_handler, domain);
161161

162162
ar5312_misc_irq_domain = domain;
163163
}

0 commit comments

Comments
 (0)