From 6aa6690277e4a1551ed6c6b8482e513253d6865b Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Fri, 28 Jul 2017 15:00:40 +0600 Subject: host/trxcon/scheduler: fix possible NULL deference We should make sure that required timeslot is not only allocated, but also configured, i.e. has a correct multiframe layout. Change-Id: I1d0b870c389802b51c709d089b80ac3fb3565fa8 --- src/host/trxcon/sched_trx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/host/trxcon/sched_trx.c b/src/host/trxcon/sched_trx.c index 3e615825..cf05bb66 100644 --- a/src/host/trxcon/sched_trx.c +++ b/src/host/trxcon/sched_trx.c @@ -423,9 +423,9 @@ int sched_trx_handle_rx_burst(struct trx_instance *trx, uint8_t tn, uint32_t fn, elapsed; uint8_t offset, bid; - /* Check whether required timeslot is enabled / configured */ + /* Check whether required timeslot is allocated and configured */ ts = sched_trx_find_ts(trx, tn); - if (ts == NULL) { + if (ts == NULL || ts->mf_layout == NULL) { LOGP(DSCH, LOGL_DEBUG, "TDMA timeslot #%u isn't configured, " "ignoring burst...\n", tn); return -EINVAL; -- cgit v1.2.3