pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-pcu/+/29910 )
Change subject: rcv_resource_request(): Validate expected message before MS lookup & allocation ......................................................................
rcv_resource_request(): Validate expected message before MS lookup & allocation
There's no sense if doing the lookup and allocation if the message is not expected, it will be unrefed (freed) afterwards anyway. Moreover, this way we avoid doing stuff for the WIP code paths which act on different request ID than TLLI.
Change-Id: I4be8858230a2eebdb33260093d082a005cb9fcd4 --- M src/pdch.cpp 1 file changed, 7 insertions(+), 7 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/10/29910/1
diff --git a/src/pdch.cpp b/src/pdch.cpp index 56cc958..46df0d5 100644 --- a/src/pdch.cpp +++ b/src/pdch.cpp @@ -647,10 +647,16 @@ struct gprs_rlcmac_sba *sba; int rc; struct gprs_rlcmac_bts *bts = trx->bts; + struct pdch_ulc_node *item; + + if (!(item = pdch_ulc_get_node(ulc, fn))) { + LOGPDCH(this, DRLCMAC, LOGL_NOTICE, "FN=%u PKT RESOURCE REQ: " + "UL block not reserved\n", fn); + return; + }
if (request->ID.UnionType) { struct gprs_rlcmac_ul_tbf *ul_tbf = NULL; - struct pdch_ulc_node *item; uint32_t tlli = request->ID.u.TLLI;
GprsMs *ms = bts_ms_by_tlli(bts, tlli, GSM_RESERVED_TMSI); @@ -662,12 +668,6 @@ /* Keep the ms, even if it gets idle temporarily */ ms_ref(ms);
- if (!(item = pdch_ulc_get_node(ulc, fn))) { - LOGPDCH(this, DRLCMAC, LOGL_NOTICE, "FN=%u PKT RESOURCE REQ: " - "UL block not reserved\n", fn); - goto return_unref; - } - switch (item->type) { case PDCH_ULC_NODE_TBF_USF: /* Is it actually valid for an MS to send a PKT Res Req during USF? */