diff --git a/openair2/LAYER2/MAC/main.c b/openair2/LAYER2/MAC/main.c index 2347a7d9b97482a2581c779e24a12b41209eec08..ec6b0cd666cd15416b6bf4ceaeda2cf8b57261af 100644 --- a/openair2/LAYER2/MAC/main.c +++ b/openair2/LAYER2/MAC/main.c @@ -68,17 +68,17 @@ void mac_top_init_eNB(void) RC.nb_macrlc_inst * sizeof(eNB_MAC_INST *), RC.nb_macrlc_inst, sizeof(eNB_MAC_INST)); for (i = 0; i < RC.nb_macrlc_inst; i++) { - if (RC.mac[i] == NULL) - RC.mac[i] = (eNB_MAC_INST *) malloc16(sizeof(eNB_MAC_INST)); - AssertFatal(RC.mac != NULL, - "can't ALLOCATE %zu Bytes for %d eNB_MAC_INST with size %zu \n", - RC.nb_macrlc_inst * sizeof(eNB_MAC_INST *), - RC.nb_macrlc_inst, sizeof(eNB_MAC_INST)); - LOG_D(MAC, - "[MAIN] ALLOCATE %zu Bytes for %d eNB_MAC_INST @ %p\n", - sizeof(eNB_MAC_INST), RC.nb_macrlc_inst, RC.mac); - if (RC.mac[i] == NULL) bzero(RC.mac[i], sizeof(eNB_MAC_INST)); - // bzero(RC.mac[i], sizeof(eNB_MAC_INST)); + if (RC.mac[i] == NULL) { + RC.mac[i] = (eNB_MAC_INST *) malloc16(sizeof(eNB_MAC_INST)); + AssertFatal(RC.mac[i] != NULL, + "can't ALLOCATE %zu Bytes for %d eNB_MAC_INST with size %zu \n", + RC.nb_macrlc_inst * sizeof(eNB_MAC_INST *), + RC.nb_macrlc_inst, sizeof(eNB_MAC_INST)); + LOG_D(MAC, + "[MAIN] ALLOCATE %zu Bytes for %d eNB_MAC_INST @ %p\n", + sizeof(eNB_MAC_INST), RC.nb_macrlc_inst, RC.mac); + bzero(RC.mac[i], sizeof(eNB_MAC_INST)); + } RC.mac[i]->Mod_id = i; for (j = 0; j < MAX_NUM_CCs; j++) { RC.mac[i]->DL_req[j].dl_config_request_body.