linux/drivers/pps/clients
Eliav Farber 6bca1e9558 pps: clients: gpio: fix interrupt handling order in remove path
The interrupt handler in pps_gpio_probe() is registered after calling
pps_register_source() using devm_request_irq(). However, in the
corresponding remove function, pps_unregister_source() is called before
the IRQ is freed, since devm-managed resources are released after the
remove function completes.

This creates a potential race condition where an interrupt may occur
after the PPS source is unregistered but before the handler is removed,
possibly leading to a kernel panic.

To prevent this, switch from devm-managed IRQ registration to manual
management by using request_irq() and calling free_irq() explicitly in
the remove path before unregistering the PPS source. This ensures the
interrupt handler is safely removed before deactivating the PPS source.

Signed-off-by: Eliav Farber <farbere@amazon.com>
Link: https://lore.kernel.org/r/20250527053355.37185-1-farbere@amazon.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-07-01 12:29:24 +02:00
..
Kconfig
Makefile
pps_parport.c pps: Fix a use-after-free 2025-01-07 15:16:48 +01:00
pps-gpio.c pps: clients: gpio: fix interrupt handling order in remove path 2025-07-01 12:29:24 +02:00
pps-ktimer.c treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
pps-ldisc.c pps: Fix a use-after-free 2025-01-07 15:16:48 +01:00