Commit af63f3f9 authored by Bartosz Podrygajlo's avatar Bartosz Podrygajlo

Add missing asserts for mac->if_mutex lock/unlock calls

parent 4d070036
......@@ -885,7 +885,8 @@ void nr_rrc_mac_config_req_mib(module_id_t module_id,
else if (sched_sib == 2)
mac->get_otherSI = true;
nr_ue_decode_mib(mac, cc_idP);
pthread_mutex_unlock(&mac->if_mutex);
ret = pthread_mutex_unlock(&mac->if_mutex);
AssertFatal(!ret, "mutex failed %d\n", ret);
}
static void setup_puschpowercontrol(NR_UE_MAC_INST_t *mac, NR_PUSCH_PowerControl_t *source, NR_PUSCH_PowerControl_t *target)
......@@ -1654,7 +1655,8 @@ void nr_rrc_mac_config_req_reset(module_id_t module_id,
default:
AssertFatal(false, "Invalid MAC reset cause %d\n", cause);
}
pthread_mutex_unlock(&mac->if_mutex);
ret = pthread_mutex_unlock(&mac->if_mutex);
AssertFatal(!ret, "mutex failed %d\n", ret);
}
static int get_ta_offset(long *n_TimingAdvanceOffset)
......@@ -1716,7 +1718,8 @@ void nr_rrc_mac_config_req_sib1(module_id_t module_id,
if (!get_softmodem_params()->emulate_l1)
mac->if_module->phy_config_request(&mac->phy_config);
pthread_mutex_unlock(&mac->if_mutex);
ret = pthread_mutex_unlock(&mac->if_mutex);
AssertFatal(!ret, "mutex failed %d\n", ret);
}
void nr_rrc_mac_config_req_sib19_r17(module_id_t module_id,
......@@ -2573,5 +2576,6 @@ void nr_rrc_mac_config_req_cg(module_id_t module_id,
if (!mac->dl_config_request || !mac->ul_config_request)
ue_init_config_request(mac, mac->current_DL_BWP->scs);
pthread_mutex_unlock(&mac->if_mutex);
ret = pthread_mutex_unlock(&mac->if_mutex);
AssertFatal(!ret, "mutex failed %d\n", ret);
}
......@@ -1150,8 +1150,8 @@ int nr_ue_ul_indication(nr_uplink_indication_t *ul_info)
if (is_nr_UL_slot(mac->tdd_UL_DL_ConfigurationCommon, ul_info->slot, mac->frame_type))
nr_ue_ul_scheduler(mac, ul_info);
pthread_mutex_unlock(&mac->if_mutex);
ret = pthread_mutex_unlock(&mac->if_mutex);
AssertFatal(!ret, "mutex failed %d\n", ret);
return 0;
}
......@@ -1272,16 +1272,19 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info)
else
// DL indication to process data channels
ret2 = nr_ue_dl_processing(dl_info);
pthread_mutex_unlock(&mac->if_mutex);
ret = pthread_mutex_unlock(&mac->if_mutex);
AssertFatal(!ret, "mutex failed %d\n", ret);
return ret2;
}
void nr_ue_slot_indication(uint8_t mod_id)
{
NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id);
pthread_mutex_lock(&mac->if_mutex);
int ret = pthread_mutex_lock(&mac->if_mutex);
AssertFatal(!ret, "mutex failed %d\n", ret);
update_mac_timers(mac);
pthread_mutex_unlock(&mac->if_mutex);
ret = pthread_mutex_unlock(&mac->if_mutex);
AssertFatal(!ret, "mutex failed %d\n", ret);
}
nr_ue_if_module_t *nr_ue_if_module_init(uint32_t module_id)
......
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