Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c4c0d690 authored by Andre Eisenbach's avatar Andre Eisenbach
Browse files

Fix error in tick calculation when timer is removed

A previous changed introduced an error in the timer tick calculation
when removing a timer. This could lead to timers expiring sooner than
expected.

Bug: 17390240
Change-Id: Id3291aaf492a7178782e6f804dad71387c3c9382
parent 17d9ebbd
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -704,9 +704,6 @@ BOOLEAN GKI_remove_from_timer_list (TIMER_LIST_Q *p_timer_listq, TIMER_LIST_ENT
    if (p_tle == NULL || p_timer_listq->p_first == NULL)
        return FALSE;

    p_tle->ticks = 0;
    p_tle->in_use = FALSE;

    /* Add the ticks remaining in this timer (if any) to the next guy in the list.
    ** Note: Expired timers have a tick value of '0'.
    */
@@ -715,6 +712,9 @@ BOOLEAN GKI_remove_from_timer_list (TIMER_LIST_Q *p_timer_listq, TIMER_LIST_ENT
        p_tle->p_next->ticks += p_tle->ticks;
    }

    p_tle->ticks = 0;
    p_tle->in_use = FALSE;

    /* Unlink timer from the list.
    */
    if (p_timer_listq->p_first == p_tle)