aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/scheduler.c
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2016-11-24 12:42:25 +0100
committerHarald Welte <laforge@gnumonks.org>2016-12-05 18:55:49 +0000
commit960dd993cdc16d9e268f83f5c7ca294a96a5048f (patch)
tree4111195bfe5292efcbb65ebdf494ff03752f4bce /src/common/scheduler.c
parent20363d165e4979ee74054bfbbc0419184e9846f8 (diff)
TRX: prevent segfault upon phy init
Previously if multiply phy instances were configured but not used osmo-bts-trx would segfault. Terminate with clear error message instead so user can correct configuration. Example configuration which caused problem: ... phy 0 instance 0 instance 1 ... trx 0 phy 0 instance 0 Note the 2nd instance of phy 0 which is not used in trx later on. Change-Id: Id979506731ea92401458f1060e87aeb690901539
Diffstat (limited to 'src/common/scheduler.c')
-rw-r--r--src/common/scheduler.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/common/scheduler.c b/src/common/scheduler.c
index db1f9770..fd5c5840 100644
--- a/src/common/scheduler.c
+++ b/src/common/scheduler.c
@@ -166,6 +166,9 @@ int trx_sched_init(struct l1sched_trx *l1t, struct gsm_bts_trx *trx)
uint8_t tn;
unsigned int i;
+ if (!trx)
+ return -EINVAL;
+
l1t->trx = trx;
LOGP(DL1C, LOGL_NOTICE, "Init scheduler for trx=%u\n", l1t->trx->nr);