diff --git a/srsue/src/stack/mac_nr/proc_bsr_nr.cc b/srsue/src/stack/mac_nr/proc_bsr_nr.cc index 753ff8f38..70e40e5b5 100644 --- a/srsue/src/stack/mac_nr/proc_bsr_nr.cc +++ b/srsue/src/stack/mac_nr/proc_bsr_nr.cc @@ -247,13 +247,14 @@ int proc_bsr_nr::setup_lcid(uint32_t lcid, uint32_t new_lcg, uint32_t priority) std::lock_guard lock(mutex); // Check that the new priority doesn't not already exist - if (lcg_priorities.find(priority) != lcg_priorities.end()) { + auto it = lcg_priorities.find(priority); + if (it != lcg_priorities.end() and *it != new_lcg) { logger.error( - "BSR: Invalid config. Priority=%d already configured for lcg=%d", priority, lcg_priorities.at(priority)); + "BSR: Invalid config. Priority=%d already configured for lcg=%d", priority, *it); return SRSRAN_ERROR; } - lcg_priorities[priority] = new_lcg; + *it = new_lcg; return SRSRAN_SUCCESS; }