fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/31671 )
Change subject: osmo-bts-trx: check lchan against NULL in bts_model_l1sap_down() ......................................................................
osmo-bts-trx: check lchan against NULL in bts_model_l1sap_down()
Even though it's unlikely, get_lchan_by_chan_nr() *may* return NULL.
Change-Id: I1a815c9675eebc16640b62308499dd784fc206bd Related: OS#1572 --- M src/osmo-bts-trx/l1_if.c 1 file changed, 19 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/71/31671/1
diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c index 78a379b..af4762a 100644 --- a/src/osmo-bts-trx/l1_if.c +++ b/src/osmo-bts-trx/l1_if.c @@ -401,6 +401,13 @@ else /* u.act_req used by PRIM_INFO_{ACTIVATE,DEACTIVATE,MODIFY} */ chan_nr = l1sap->u.info.u.act_req.chan_nr; lchan = get_lchan_by_chan_nr(trx, chan_nr); + if (OSMO_UNLIKELY(lchan == NULL)) { + LOGP(DL1C, LOGL_ERROR, + "Rx MPH-INFO.req (type=0x%02x) for non-existent lchan (%s)\n", + l1sap->u.info.type, rsl_chan_nr_str(chan_nr)); + rc = -ENODEV; + break; + }
switch (l1sap->u.info.type) { case PRIM_INFO_ACT_CIPH: