mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
pinctrl/mediatek: 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: Linus Walleij <[email protected]> Cc: Matthias Brugger <[email protected]> Cc: Hongzhou Yang <[email protected]> Cc: Axel Lin <[email protected]> Cc: Yingjoe Chen <[email protected]> Cc: Maoguang Meng <[email protected]> Cc: Colin Ian King <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected]
This commit is contained in:
parent
2cf5a03cb2
commit
1e10592136
1 changed files with 1 additions and 2 deletions
|
|
@ -1242,8 +1242,7 @@ int mtk_pctrl_init(struct platform_device *pdev,
|
|||
set_irq_flags(virq, IRQF_VALID);
|
||||
};
|
||||
|
||||
irq_set_chained_handler(irq, mtk_eint_irq_handler);
|
||||
irq_set_handler_data(irq, pctl);
|
||||
irq_set_chained_handler_and_data(irq, mtk_eint_irq_handler, pctl);
|
||||
set_irq_flags(irq, IRQF_VALID);
|
||||
return 0;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue