mirror of https://github.com/PentHertz/srsLTE.git
- fixes crash on initialization. Now the program exits cleanly
This commit is contained in:
parent
a8099d0df9
commit
f1cd4b1f0d
|
@ -93,7 +93,7 @@ int enb::init(const all_args_t& args_, srslte::logger* logger_)
|
|||
|
||||
// Only init Stack if both radio and PHY could be initialized
|
||||
if (ret == SRSLTE_SUCCESS) {
|
||||
if (lte_stack->init(args.stack, rrc_cfg, lte_phy.get())) {
|
||||
if (lte_stack->init(args.stack, rrc_cfg, lte_phy.get()) != SRSLTE_SUCCESS) {
|
||||
srslte::console("Error initializing stack.\n");
|
||||
ret = SRSLTE_ERROR;
|
||||
}
|
||||
|
|
|
@ -123,7 +123,11 @@ int enb_stack_lte::init(const stack_args_t& args_, const rrc_cfg_t& rrc_cfg_)
|
|||
sync_task_queue = task_sched.make_task_queue(args.sync_queue_size);
|
||||
|
||||
// Init all layers
|
||||
mac.init(args.mac, rrc_cfg.cell_list, phy, &rlc, &rrc, mac_log);
|
||||
if (! mac.init(args.mac, rrc_cfg.cell_list, phy, &rlc, &rrc, mac_log))
|
||||
{
|
||||
stack_logger.error("Couldn't initialize MAC");
|
||||
return SRSLTE_ERROR;
|
||||
}
|
||||
rlc.init(&pdcp, &rrc, &mac, task_sched.get_timer_handler());
|
||||
pdcp.init(&rlc, &rrc, >pu);
|
||||
rrc.init(rrc_cfg, phy, &mac, &rlc, &pdcp, &s1ap, >pu);
|
||||
|
|
|
@ -79,8 +79,13 @@ bool mac::init(const mac_args_t& args_,
|
|||
|
||||
reset();
|
||||
|
||||
// Pre-alloc UE objects for first attaching users
|
||||
prealloc_ue(10);
|
||||
try {
|
||||
// Pre-alloc UE objects for first attaching users
|
||||
prealloc_ue(10);
|
||||
}catch(const std::bad_alloc& e){
|
||||
perror("Error allocating data during the ue prealloc");
|
||||
return false;
|
||||
}
|
||||
|
||||
detected_rachs.resize(cells.size());
|
||||
|
||||
|
|
Loading…
Reference in New Issue