Follow-up on #1828

This commit is contained in:
Sukchan Lee 2022-10-11 17:44:55 +09:00
parent 395707831a
commit 82863653eb
4 changed files with 33 additions and 5 deletions

View File

@ -1942,7 +1942,11 @@ enb_ue_t *enb_ue_add(mme_enb_t *enb, uint32_t enb_ue_s1ap_id)
ogs_assert(enb);
ogs_pool_alloc(&enb_ue_pool, &enb_ue);
ogs_assert(enb_ue);
if (enb_ue == NULL) {
ogs_error("Could not allocate enb_ue context from pool");
return NULL;
}
memset(enb_ue, 0, sizeof *enb_ue);
enb_ue->t_s1_holding = ogs_timer_add(
@ -2266,7 +2270,11 @@ mme_ue_t *mme_ue_add(enb_ue_t *enb_ue)
ogs_assert(enb);
ogs_pool_alloc(&mme_ue_pool, &mme_ue);
ogs_assert(mme_ue);
if (mme_ue == NULL) {
ogs_error("Could not allocate mme_ue context from pool");
return NULL;
}
memset(mme_ue, 0, sizeof *mme_ue);
/* Add All Timers */

View File

@ -250,7 +250,15 @@ void mme_state_operational(ogs_fsm_t *s, mme_event_t *e)
mme_ue = mme_ue_find_by_message(&nas_message);
if (!mme_ue) {
mme_ue = mme_ue_add(enb_ue);
ogs_assert(mme_ue);
if (mme_ue == NULL) {
ogs_expect(OGS_OK ==
s1ap_send_ue_context_release_command(enb_ue,
S1AP_Cause_PR_misc,
S1AP_CauseMisc_control_processing_overload,
S1AP_UE_CTX_REL_S1_CONTEXT_REMOVE, 0));
ogs_pkbuf_free(pkbuf);
return;
}
} else {
/* Here, if the MME_UE Context is found,
* the integrity check is not performed

View File

@ -258,7 +258,13 @@ void s1ap_handle_initial_ue_message(mme_enb_t *enb, ogs_s1ap_message_t *message)
enb_ue = enb_ue_find_by_enb_ue_s1ap_id(enb, *ENB_UE_S1AP_ID);
if (!enb_ue) {
enb_ue = enb_ue_add(enb, *ENB_UE_S1AP_ID);
ogs_assert(enb_ue);
if (enb_ue == NULL) {
ogs_assert(OGS_OK ==
s1ap_send_error_indication(enb, NULL, NULL,
S1AP_Cause_PR_misc,
S1AP_CauseMisc_control_processing_overload));
return;
}
/* Find MME_UE if S_TMSI included */
if (S_TMSI) {

View File

@ -515,7 +515,13 @@ int s1ap_send_handover_request(
ogs_assert(target_enb);
target_ue = enb_ue_add(target_enb, INVALID_UE_S1AP_ID);
ogs_assert(target_ue);
if (target_ue == NULL) {
ogs_assert(OGS_OK ==
s1ap_send_error_indication(target_enb, NULL, NULL,
S1AP_Cause_PR_misc,
S1AP_CauseMisc_control_processing_overload));
return OGS_ERROR;
}
ogs_info(" Source : ENB_UE_S1AP_ID[%d] MME_UE_S1AP_ID[%d]",
source_ue->enb_ue_s1ap_id, source_ue->mme_ue_s1ap_id);