aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2013-09-09 16:17:37 +0200
committerHarald Welte <laforge@gnumonks.org>2015-09-22 16:41:30 +0200
commitf66f5b3ddc5c894ae7ad4909cbd261c6920260b0 (patch)
tree7fd9b34d9bad506ed0631926cc16d3bbcded0786
parentc241afa87c2fa8713a1fae89e6b599e011d45c28 (diff)
TRX: Free bust buffer memory to when changing lchan type
-rw-r--r--src/osmo-bts-trx/scheduler.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/osmo-bts-trx/scheduler.c b/src/osmo-bts-trx/scheduler.c
index 4cf6a68..f4b0d9c 100644
--- a/src/osmo-bts-trx/scheduler.c
+++ b/src/osmo-bts-trx/scheduler.c
@@ -2496,6 +2496,15 @@ int trx_sched_set_lchan(struct trx_l1h *l1h, uint8_t chan_nr, uint8_t link_id,
if (active)
memset(chan_state, 0, sizeof(*chan_state));
chan_state->active = active;
+ /* free burst memory, to cleanly start with burst 0 */
+ if (chan_state->dl_bursts) {
+ talloc_free(chan_state->dl_bursts);
+ chan_state->dl_bursts = NULL;
+ }
+ if (chan_state->ul_bursts) {
+ talloc_free(chan_state->ul_bursts);
+ chan_state->ul_bursts = NULL;
+ }
}
}