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:
Vladimir Kondratyev 2024-04-08 09:47:42 +03:00
parent 9289c1f6f1
commit 61fb195e8d

View file

@ -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));
}