From cf12c98630cf186005d61dcaa42f70a324fe4d76 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Mon, 29 Jun 2020 17:40:13 +0200 Subject: [PATCH] srsue: exit early if radio can't be initialized since the radio is the first component we initialize, it is safe to exit the ue::init() straight away, as no other layers use any handles yet --- srsue/src/ue.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/srsue/src/ue.cc b/srsue/src/ue.cc index 446dcf845..49e788f30 100644 --- a/srsue/src/ue.cc +++ b/srsue/src/ue.cc @@ -95,12 +95,13 @@ int ue::init(const all_args_t& args_, srslte::logger* logger_) return SRSLTE_ERROR; } - // init layers (do not exit immedietly if something goes wrong as sub-layers may already use interfaces) + // init layers if (lte_radio->init(args.rf, lte_phy.get())) { log.console("Error initializing radio.\n"); - ret = SRSLTE_ERROR; + return SRSLTE_ERROR; } + // from here onwards do not exit immediately if something goes wrong as sub-layers may already use interfaces if (lte_phy->init(args.phy, lte_stack.get(), lte_radio.get())) { log.console("Error initializing PHY.\n"); ret = SRSLTE_ERROR;