mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 00:02:14 -04:00
LinuxKPI: Improve timer_shutdown_sync
timer_shutdown_sync not only shutdowns a timer but prevents it rearming. Sponsored by: Serenity CyberSecurity, LLC Reviewed by: emaste MFC after: 1 week
This commit is contained in:
parent
9289c1f6f1
commit
61fb195e8d
1 changed files with 5 additions and 0 deletions
|
|
@ -1920,6 +1920,10 @@ linux_timer_callback_wrapper(void *context)
|
|||
|
||||
timer = context;
|
||||
|
||||
/* the timer is about to be shutdown permanently */
|
||||
if (timer->function == NULL)
|
||||
return;
|
||||
|
||||
if (linux_set_current_flags(curthread, M_NOWAIT)) {
|
||||
/* try again later */
|
||||
callout_reset(&timer->callout, 1,
|
||||
|
|
@ -1992,6 +1996,7 @@ int
|
|||
timer_shutdown_sync(struct timer_list *timer)
|
||||
{
|
||||
|
||||
timer->function = NULL;
|
||||
return (del_timer_sync(timer));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue