summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2017-08-16 14:05:24 +0600
committerVadim Yanitskiy <axilirator@gmail.com>2017-11-19 17:35:07 +0700
commite38b500794456a353055639bedf91ac182d90419 (patch)
treeb97f164bdbe59e146369fa7e458a64c4ac846df2 /src
parent863ccb7bd28e5342b84517afc01103b719f1d7ec (diff)
host/trxcon/scheduler: fix prim queue flushing function
For some reasons, the function, which is used to flush a queue of transmit primitives, was intended to flush a list of msgb instances instead of trx_ts_prim, so memory was being cleaned incorrectly. Moreover, the items weren't actually removed from queue. Change-Id: Ia84b57350a5c2eee0afebc65f62e30eaddb141d4
Diffstat (limited to 'src')
-rw-r--r--src/host/trxcon/sched_trx.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/host/trxcon/sched_trx.c b/src/host/trxcon/sched_trx.c
index 7f6729cb..c7520b91 100644
--- a/src/host/trxcon/sched_trx.c
+++ b/src/host/trxcon/sched_trx.c
@@ -37,12 +37,14 @@
#include "trx_if.h"
#include "logging.h"
-static void msgb_queue_flush(struct llist_head *list)
+static void prim_queue_flush(struct llist_head *list)
{
- struct msgb *msg, *msg2;
+ struct trx_ts_prim *prim, *prim_next;
- llist_for_each_entry_safe(msg, msg2, list, list)
- msgb_free(msg);
+ llist_for_each_entry_safe(prim, prim_next, list, list) {
+ llist_del(&prim->list);
+ talloc_free(prim);
+ }
}
static void sched_frame_clck_cb(struct trx_sched *sched)
@@ -191,7 +193,7 @@ void sched_trx_del_ts(struct trx_instance *trx, int tn)
LOGP(DSCH, LOGL_NOTICE, "Delete TDMA timeslot #%u\n", tn);
/* Flush queue primitives for TX */
- msgb_queue_flush(&ts->tx_prims);
+ prim_queue_flush(&ts->tx_prims);
/* Remove ts from list and free memory */
trx->ts_list[tn] = NULL;
@@ -278,7 +280,7 @@ int sched_trx_reset_ts(struct trx_instance *trx, int tn)
ts->mf_layout = NULL;
/* Flush queue primitives for TX */
- msgb_queue_flush(&ts->tx_prims);
+ prim_queue_flush(&ts->tx_prims);
/* Free channel states */
talloc_free(ts->lchans);