iu_client: ensure UE is not NULL on CO primitives

When ue_conn_ctx_find() can not find a UE it returns NULL.

Change-Id: I63222fda6778417b1c986cb05772fecc51c43bb5
This commit is contained in:
Alexander Couzens 2019-08-13 17:06:17 +02:00
parent 80307924f1
commit 87482b335c
1 changed files with 6 additions and 0 deletions

View File

@ -796,6 +796,9 @@ static int sccp_sap_up(struct osmo_prim_hdr *oph, void *_scu)
LOGPIU(LOGL_DEBUG, "N-DISCONNECT.ind(%u)\n",
prim->u.disconnect.conn_id);
ue = ue_conn_ctx_find(prim->u.disconnect.conn_id);
if (!ue)
break;
rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg));
break;
case OSMO_PRIM(OSMO_SCU_PRIM_N_DATA, PRIM_OP_INDICATION):
@ -804,6 +807,9 @@ static int sccp_sap_up(struct osmo_prim_hdr *oph, void *_scu)
osmo_hexdump(msgb_l2(oph->msg), msgb_l2len(oph->msg)));
/* resolve UE context */
ue = ue_conn_ctx_find(prim->u.data.conn_id);
if (!ue)
break;
rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg));
break;
case OSMO_PRIM(OSMO_SCU_PRIM_N_UNITDATA, PRIM_OP_INDICATION):