kernel: Fix kernel panic when adding a timer before another one

This was caused because add_to_timer_queue() did not set active_clock when inserting a timer before the end, making disarm() a no-op.
Therefore, the clock would continue to use the timer after it had been freed.
This commit is contained in:
apio 2024-01-06 18:12:25 +01:00
parent 4019cf90cf
commit fd402083d7
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -79,6 +79,7 @@ void Clock::add_to_timer_queue(Timer* timer)
{ {
t->delta_ticks -= timer->delta_ticks; t->delta_ticks -= timer->delta_ticks;
m_timer_queue.add_before(t, timer); m_timer_queue.add_before(t, timer);
timer->active_clock = this;
return; return;
} }
timer->delta_ticks -= t->delta_ticks; timer->delta_ticks -= t->delta_ticks;