fsm: delete the timer when changing state

In osmo_fsm_inst_state_chg(), we need to stop any not-yet-expired timer
of the old state before transitioning into the new state.

Change-Id: I2558f9a7027a877ea8263785ed3c8d70d2513996
This commit is contained in:
Harald Welte 2016-07-10 15:13:51 +02:00
parent f3239113db
commit 02a6672885
1 changed files with 3 additions and 0 deletions

View File

@ -318,6 +318,9 @@ int osmo_fsm_inst_state_chg(struct osmo_fsm_inst *fi, uint32_t new_state,
return -EPERM;
}
/* delete the old timer */
osmo_timer_del(&fi->timer);
if (st->onleave)
st->onleave(fi, new_state);