Harald Welte has submitted this change and it was merged. Change subject: trxcon/sched_trx.c: fix: properly deallocate lchans ......................................................................
trxcon/sched_trx.c: fix: properly deallocate lchans The llist_for_each_entry_safe() should be used instead of the llist_for_each_entry(), because it's safe against removal of llist entry. Found using Valgrind's memcheck tool. Change-Id: I65234971ec152df038c5388da537a503060c215b --- M src/host/trxcon/sched_trx.c 1 file changed, 4 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/trxcon/sched_trx.c b/src/host/trxcon/sched_trx.c index 9ae5a8f..1197f2c 100644 --- a/src/host/trxcon/sched_trx.c +++ b/src/host/trxcon/sched_trx.c @@ -185,7 +185,7 @@ void sched_trx_del_ts(struct trx_instance *trx, int tn) { - struct trx_lchan_state *lchan; + struct trx_lchan_state *lchan, *lchan_next; struct trx_ts *ts; /* Find ts in list */ @@ -199,8 +199,10 @@ sched_trx_deactivate_all_lchans(ts); /* Free channel states */ - llist_for_each_entry(lchan, &ts->lchans, list) + llist_for_each_entry_safe(lchan, lchan_next, &ts->lchans, list) { + llist_del(&lchan->list); talloc_free(lchan); + } /* Flush queue primitives for TX */ sched_prim_flush_queue(&ts->tx_prims); -- To view, visit https://gerrit.osmocom.org/7202 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I65234971ec152df038c5388da537a503060c215b Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: fixeria/trx Gerrit-Owner: Vadim Yanitskiy <axilira...@gmail.com> Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org> Gerrit-Reviewer: Jenkins Builder