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:
parent
4019cf90cf
commit
fd402083d7
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user