scheduler: Fix FACCH msg with l2len==0 going to lower layers and logging errors

Recent commit (see below) changed a check to avoid weird results for msg
which had l2h=NULL, since l2len would return unexpected results there.
However, some code branches like FACCH or TCH seem to be always setting
l2h even if len=0. Hence, we must test either of the 2 scenarios (null
pointer and l2len()).

This commit fixes the following message appearing all the time during
calls:
"""
TCH/F: Prim has odd len=0 != 23
"""

Fixes: fb905b8d23
Related: SYS#5676
Related: SYS#4919
Change-Id: I43152bc8484a35cd004d3303d3a6e6efcdefa890
This commit is contained in:
Pau Espin 2021-11-03 18:28:40 +01:00
parent c64d7ae4a1
commit 5826136a9d
1 changed files with 1 additions and 1 deletions

View File

@ -869,7 +869,7 @@ int trx_sched_ph_data_req(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap
OSMO_ASSERT(l1sap->oph.msg);
/* ignore empty frame */
if (!l1sap->oph.msg->l2h) {
if (!l1sap->oph.msg->l2h || msgb_l2len(l1sap->oph.msg) == 0) {
msgb_free(l1sap->oph.msg);
return 0;
}