aboutsummaryrefslogtreecommitdiffstats
path: root/tests/handover/handover_test.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2021-05-11 17:22:57 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2021-05-21 15:43:30 +0200
commitf9fea61fa9845b6259ea5aa5ac0dfa059a7de330 (patch)
tree6ef18595f15b655399963de7f6336963cc73ecbb /tests/handover/handover_test.c
parent4ab0555f39b8e6356c859d775e6c0ef070ff222e (diff)
handover_test: ack release only when lchan is still waiting
Diffstat (limited to 'tests/handover/handover_test.c')
-rw-r--r--tests/handover/handover_test.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c
index d2b175711..8e23a4f2f 100644
--- a/tests/handover/handover_test.c
+++ b/tests/handover/handover_test.c
@@ -439,12 +439,14 @@ struct gsm_lchan *create_lchan(struct gsm_bts *bts, int full_rate, const char *c
static void lchan_release_ack(struct gsm_lchan *lchan)
{
- if (lchan->fi && lchan->fi->state == LCHAN_ST_WAIT_BEFORE_RF_RELEASE) {
- /* don't wait before release */
- osmo_fsm_inst_state_chg(lchan->fi, LCHAN_ST_WAIT_RF_RELEASE_ACK, 0, 0);
- /* ack the release */
- osmo_fsm_inst_dispatch(lchan->fi, LCHAN_EV_RSL_RF_CHAN_REL_ACK, 0);
- }
+ if (!lchan->fi || lchan->fi->state != LCHAN_ST_WAIT_BEFORE_RF_RELEASE)
+ return;
+ /* don't wait before release */
+ osmo_fsm_inst_state_chg(lchan->fi, LCHAN_ST_WAIT_RF_RELEASE_ACK, 0, 0);
+ if (lchan->fi->state == LCHAN_ST_UNUSED)
+ return;
+ /* ack the release */
+ osmo_fsm_inst_dispatch(lchan->fi, LCHAN_EV_RSL_RF_CHAN_REL_ACK, 0);
}
static void lchan_clear(struct gsm_lchan *lchan)