summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2017-07-28 15:00:40 +0600
committerVadim Yanitskiy <axilirator@gmail.com>2017-10-23 22:05:49 +0330
commitd18a914aa71d9e65b45ee5878636554c9da922bc (patch)
tree75d0bfbe580ff3c95c07f2926a7176f0bfa953d5
parent49bf1fde69bacd3c78178cbeb0cc25baae14144c (diff)
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
-rw-r--r--src/host/trxcon/sched_trx.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/host/trxcon/sched_trx.c b/src/host/trxcon/sched_trx.c
index 3e61582..cf05bb6 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;