aboutsummaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/lchan.c13
-rw-r--r--src/common/rsl.c15
2 files changed, 11 insertions, 17 deletions
diff --git a/src/common/lchan.c b/src/common/lchan.c
index 28ea943a..a3be4ee0 100644
--- a/src/common/lchan.c
+++ b/src/common/lchan.c
@@ -231,8 +231,6 @@ void gsm_lchan_release(struct gsm_lchan *lchan, enum lchan_rel_act_kind rel_kind
}
l1sap_chan_rel(lchan->ts->trx, gsm_lchan2chan_nr(lchan));
-
- lapdm_channel_exit(&lchan->lapdm_ch);
}
int lchan_deactivate(struct gsm_lchan *lchan)
@@ -290,6 +288,17 @@ void lchan_set_state(struct gsm_lchan *lchan, enum gsm_lchan_state state)
osmo_tdef_get(abis_T_defs, -15, OSMO_TDEF_US, -1));
}
break;
+ case LCHAN_S_NONE:
+ lapdm_channel_exit(&lchan->lapdm_ch);
+ /* Also ensure that there are no leftovers from repeated FACCH or
+ * repeated SACCH that might cause memory leakage. */
+ msgb_free(lchan->tch.rep_facch[0].msg);
+ msgb_free(lchan->tch.rep_facch[1].msg);
+ lchan->tch.rep_facch[0].msg = NULL;
+ lchan->tch.rep_facch[1].msg = NULL;
+ msgb_free(lchan->rep_sacch);
+ lchan->rep_sacch = NULL;
+ /* fall through */
default:
if (lchan->early_rr_ia) {
/* Early Immediate Assignment: Transition to any other
diff --git a/src/common/rsl.c b/src/common/rsl.c
index 99e81952..145cc8a9 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -1296,21 +1296,6 @@ int rsl_tx_rf_rel_ack(struct gsm_lchan *lchan)
gsm_ts_and_pchan_name(lchan->ts), lchan->nr,
gsm_lchant_name(lchan->type));
- /*
- * Free the LAPDm resources now that the BTS
- * has released all the resources.
- */
- lapdm_channel_exit(&lchan->lapdm_ch);
-
- /* Also ensure that there are no leftovers from repeated FACCH or
- * repeated SACCH that might cause memory leakage. */
- msgb_free(lchan->tch.rep_facch[0].msg);
- msgb_free(lchan->tch.rep_facch[1].msg);
- lchan->tch.rep_facch[0].msg = NULL;
- lchan->tch.rep_facch[1].msg = NULL;
- msgb_free(lchan->rep_sacch);
- lchan->rep_sacch = NULL;
-
return tx_rf_rel_ack(lchan, chan_nr);
}