Commit 556d5a65 authored by Frédéric Leroy's avatar Frédéric Leroy

UE/*: exit on error

parent fcf2444e
...@@ -109,7 +109,7 @@ void IdleMode_initialize(nas_user_t *user, IdleMode_callback_t cb) ...@@ -109,7 +109,7 @@ void IdleMode_initialize(nas_user_t *user, IdleMode_callback_t cb)
emm_plmn_list_t *emm_plmn_list = calloc(1, sizeof(emm_plmn_list_t)); emm_plmn_list_t *emm_plmn_list = calloc(1, sizeof(emm_plmn_list_t));
if ( emm_plmn_list == NULL ) { if ( emm_plmn_list == NULL ) {
LOG_TRACE(ERROR, "EMM - Can't alloc emm_plmn_list"); LOG_TRACE(ERROR, "EMM - Can't alloc emm_plmn_list");
// FIXME stop here exit(EXIT_FAILURE);
} }
user->emm_plmn_list = emm_plmn_list; user->emm_plmn_list = emm_plmn_list;
/* Initialize the list of available PLMNs */ /* Initialize the list of available PLMNs */
......
...@@ -137,7 +137,7 @@ void emm_main_initialize(nas_user_t *user, emm_indication_callback_t cb, const c ...@@ -137,7 +137,7 @@ void emm_main_initialize(nas_user_t *user, emm_indication_callback_t cb, const c
user->emm_data = calloc(1, sizeof(emm_data_t)); user->emm_data = calloc(1, sizeof(emm_data_t));
if ( user->emm_data == NULL ) { if ( user->emm_data == NULL ) {
LOG_TRACE(ERROR, "EMM-MAIN - Failed to get allocate emm_data"); LOG_TRACE(ERROR, "EMM-MAIN - Failed to get allocate emm_data");
// FIXME stop here exit(EXIT_FAILURE);
} }
/* USIM validity indicator */ /* USIM validity indicator */
user->emm_data->usim_is_valid = FALSE; user->emm_data->usim_is_valid = FALSE;
...@@ -400,7 +400,7 @@ void emm_main_initialize(nas_user_t *user, emm_indication_callback_t cb, const c ...@@ -400,7 +400,7 @@ void emm_main_initialize(nas_user_t *user, emm_indication_callback_t cb, const c
user->emm_data->emm_timers = calloc(1, sizeof(emm_timers_t)); user->emm_data->emm_timers = calloc(1, sizeof(emm_timers_t));
if ( user->emm_data->emm_timers == NULL ) { if ( user->emm_data->emm_timers == NULL ) {
LOG_TRACE(ERROR, "EMM-MAIN - Failed to alloc emm_timers"); LOG_TRACE(ERROR, "EMM-MAIN - Failed to alloc emm_timers");
// FIXME stop here exit(EXIT_FAILURE);
} }
_emm_timers_initialize(user->emm_data->emm_timers); _emm_timers_initialize(user->emm_data->emm_timers);
...@@ -410,7 +410,7 @@ void emm_main_initialize(nas_user_t *user, emm_indication_callback_t cb, const c ...@@ -410,7 +410,7 @@ void emm_main_initialize(nas_user_t *user, emm_indication_callback_t cb, const c
user->emm_data->emm_detach_data = calloc(1, sizeof(emm_detach_data_t)); user->emm_data->emm_detach_data = calloc(1, sizeof(emm_detach_data_t));
if ( user->emm_data->emm_detach_data == NULL ) { if ( user->emm_data->emm_detach_data == NULL ) {
LOG_TRACE(ERROR, "EMM-MAIN - Failed to alloc emm_timers"); LOG_TRACE(ERROR, "EMM-MAIN - Failed to alloc emm_timers");
// FIXME stop here exit(EXIT_FAILURE);
} }
_emm_detach_initialize(user->emm_data->emm_detach_data); _emm_detach_initialize(user->emm_data->emm_detach_data);
...@@ -420,7 +420,7 @@ void emm_main_initialize(nas_user_t *user, emm_indication_callback_t cb, const c ...@@ -420,7 +420,7 @@ void emm_main_initialize(nas_user_t *user, emm_indication_callback_t cb, const c
user->emm_data->emm_attach_data = calloc(1, sizeof(emm_attach_data_t)); user->emm_data->emm_attach_data = calloc(1, sizeof(emm_attach_data_t));
if ( user->emm_data->emm_attach_data == NULL ) { if ( user->emm_data->emm_attach_data == NULL ) {
LOG_TRACE(ERROR, "EMM-MAIN - Failed to alloc emm_timers"); LOG_TRACE(ERROR, "EMM-MAIN - Failed to alloc emm_timers");
// FIXME stop here exit(EXIT_FAILURE);
} }
_emm_attach_initialize(user->emm_data->emm_attach_data); _emm_attach_initialize(user->emm_data->emm_attach_data);
......
...@@ -119,7 +119,7 @@ esm_ebr_data_t *esm_ebr_initialize(void) ...@@ -119,7 +119,7 @@ esm_ebr_data_t *esm_ebr_initialize(void)
if ( esm_ebr_data == NULL ) { if ( esm_ebr_data == NULL ) {
LOG_TRACE(ERROR, "ESM-EBR - Can't malloc esm_ebr_data"); LOG_TRACE(ERROR, "ESM-EBR - Can't malloc esm_ebr_data");
// FIXME Stop here !!! exit(EXIT_FAILURE);
} }
esm_ebr_data->index = 0; esm_ebr_data->index = 0;
......
...@@ -81,14 +81,14 @@ void esm_main_initialize(nas_user_t *user, esm_indication_callback_t cb) ...@@ -81,14 +81,14 @@ void esm_main_initialize(nas_user_t *user, esm_indication_callback_t cb)
esm_data_t *esm_data = calloc(1, sizeof(esm_data_t)); esm_data_t *esm_data = calloc(1, sizeof(esm_data_t));
if ( esm_data == NULL ) { if ( esm_data == NULL ) {
LOG_TRACE(ERROR, "ESM-MAIN - Can't malloc esm_data"); LOG_TRACE(ERROR, "ESM-MAIN - Can't malloc esm_data");
// FIXME Stop here !!! exit(EXIT_FAILURE);
} }
user->esm_data = esm_data; user->esm_data = esm_data;
default_eps_bearer_context_data_t *default_eps_bearer_context = calloc(1, sizeof(default_eps_bearer_context_data_t)); default_eps_bearer_context_data_t *default_eps_bearer_context = calloc(1, sizeof(default_eps_bearer_context_data_t));
if ( default_eps_bearer_context == NULL ) { if ( default_eps_bearer_context == NULL ) {
LOG_TRACE(ERROR, "ESM-MAIN - Can't malloc default_eps_bearer_context"); LOG_TRACE(ERROR, "ESM-MAIN - Can't malloc default_eps_bearer_context");
// FIXME Stop here !!! exit(EXIT_FAILURE);
} }
default_eps_bearer_context->ebi = ESM_EBI_UNASSIGNED; default_eps_bearer_context->ebi = ESM_EBI_UNASSIGNED;
user->default_eps_bearer_context_data = default_eps_bearer_context; user->default_eps_bearer_context_data = default_eps_bearer_context;
......
...@@ -89,7 +89,7 @@ esm_pt_data_t *esm_pt_initialize(void) ...@@ -89,7 +89,7 @@ esm_pt_data_t *esm_pt_initialize(void)
if ( esm_pt_data == NULL ) { if ( esm_pt_data == NULL ) {
LOG_TRACE(ERROR, "ESM-PT - Can't alloc esm_pt_data"); LOG_TRACE(ERROR, "ESM-PT - Can't alloc esm_pt_data");
// FIXME Stop here !!! exit(EXIT_FAILURE);
} }
esm_pt_data->index = 0; esm_pt_data->index = 0;
......
...@@ -100,13 +100,13 @@ void nas_proc_initialize(nas_user_t *user, emm_indication_callback_t emm_cb, ...@@ -100,13 +100,13 @@ void nas_proc_initialize(nas_user_t *user, emm_indication_callback_t emm_cb,
user->authentication_data = calloc(1, sizeof(authentication_data_t)); user->authentication_data = calloc(1, sizeof(authentication_data_t));
if ( user->authentication_data == NULL ) { if ( user->authentication_data == NULL ) {
LOG_TRACE(ERROR, "NAS-PROC - Failed to alloc authentication_data"); LOG_TRACE(ERROR, "NAS-PROC - Failed to alloc authentication_data");
// FIXME stop here exit(EXIT_FAILURE);
} }
user->security_data = calloc(1, sizeof(security_data_t)); user->security_data = calloc(1, sizeof(security_data_t));
if ( user->security_data == NULL ) { if ( user->security_data == NULL ) {
LOG_TRACE(ERROR, "NAS-PROC - Failed to alloc security_data"); LOG_TRACE(ERROR, "NAS-PROC - Failed to alloc security_data");
// FIXME stop here exit(EXIT_FAILURE);
} }
/* Initialize the EMM procedure manager */ /* Initialize the EMM procedure manager */
......
...@@ -83,7 +83,7 @@ void *nas_ue_task(void *args_p) ...@@ -83,7 +83,7 @@ void *nas_ue_task(void *args_p)
if (user_api_id == NULL) { if (user_api_id == NULL) {
LOG_E(NAS, "[UE] Failed to alloc user_api_id_t"); LOG_E(NAS, "[UE] Failed to alloc user_api_id_t");
// FIXME stop here exit(EXIT_FAILURE);
} }
user->user_api_id = user_api_id; user->user_api_id = user_api_id;
...@@ -100,13 +100,13 @@ void *nas_ue_task(void *args_p) ...@@ -100,13 +100,13 @@ void *nas_ue_task(void *args_p)
user->user_at_commands = calloc(1, sizeof(user_at_commands_t)); user->user_at_commands = calloc(1, sizeof(user_at_commands_t));
if ( user->user_at_commands == NULL ) { if ( user->user_at_commands == NULL ) {
LOG_E(NAS, "[UE %d] Can't allocate memory for user_at_commands\n", 0); LOG_E(NAS, "[UE %d] Can't allocate memory for user_at_commands\n", 0);
// FIXME stop here exit(EXIT_FAILURE);
} }
user->at_response = calloc(1, sizeof(at_response_t)); user->at_response = calloc(1, sizeof(at_response_t));
if ( user->at_response == NULL ) { if ( user->at_response == NULL ) {
LOG_E(NAS, "[UE %d] Can't allocate memory for user_at_commands\n", 0); LOG_E(NAS, "[UE %d] Can't allocate memory for user_at_commands\n", 0);
// FIXME stop here exit(EXIT_FAILURE);
} }
/* Initialize NAS user */ /* Initialize NAS user */
......
...@@ -161,8 +161,7 @@ void nas_user_initialize(nas_user_t *user, emm_indication_callback_t emm_cb, ...@@ -161,8 +161,7 @@ void nas_user_initialize(nas_user_t *user, emm_indication_callback_t emm_cb,
user->nas_user_nvdata = calloc(1, sizeof(user_nvdata_t)); user->nas_user_nvdata = calloc(1, sizeof(user_nvdata_t));
if ( user->nas_user_nvdata == NULL ) { if ( user->nas_user_nvdata == NULL ) {
LOG_TRACE(ERROR, "USR-MAIN - Failed to alloc nas_user_nvdata"); LOG_TRACE(ERROR, "USR-MAIN - Failed to alloc nas_user_nvdata");
// FIXME stop here exit(EXIT_FAILURE);
return;
} }
/* Get UE's data pathname */ /* Get UE's data pathname */
...@@ -170,8 +169,7 @@ void nas_user_initialize(nas_user_t *user, emm_indication_callback_t emm_cb, ...@@ -170,8 +169,7 @@ void nas_user_initialize(nas_user_t *user, emm_indication_callback_t emm_cb,
if (path == NULL) { if (path == NULL) {
LOG_TRACE(ERROR, "USR-MAIN - Failed to get UE's data pathname"); LOG_TRACE(ERROR, "USR-MAIN - Failed to get UE's data pathname");
// FIXME return an error code or exit exit(EXIT_FAILURE);
return;
} }
/* Get UE data stored in the non-volatile memory device */ /* Get UE data stored in the non-volatile memory device */
...@@ -184,8 +182,7 @@ void nas_user_initialize(nas_user_t *user, emm_indication_callback_t emm_cb, ...@@ -184,8 +182,7 @@ void nas_user_initialize(nas_user_t *user, emm_indication_callback_t emm_cb,
user->nas_user_context = calloc(1, sizeof(nas_user_context_t)); user->nas_user_context = calloc(1, sizeof(nas_user_context_t));
if ( user->nas_user_context == NULL ) { if ( user->nas_user_context == NULL ) {
LOG_TRACE(ERROR, "USR-MAIN - Failed to alloc nas_user_context"); LOG_TRACE(ERROR, "USR-MAIN - Failed to alloc nas_user_context");
// FIXME stop here exit(EXIT_FAILURE);
return;
} }
_nas_user_context_initialize(user->nas_user_context, version); _nas_user_context_initialize(user->nas_user_context, version);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment