Commit 268d409b authored by Robert Schmidt's avatar Robert Schmidt

Prevent segfault in nr_mac_clean_cellgroup()

In some runs of a multi-UE deployment, we see segfaults because
cell_group->spCellConfig is NULL. We should not segfault in that case,
so check for spCellConfig.
parent a319cbfb
...@@ -2962,8 +2962,9 @@ void nr_csirs_scheduling(int Mod_idP, frame_t frame, sub_frame_t slot, int n_slo ...@@ -2962,8 +2962,9 @@ void nr_csirs_scheduling(int Mod_idP, frame_t frame, sub_frame_t slot, int n_slo
static void nr_mac_clean_cellgroup(NR_CellGroupConfig_t *cell_group) static void nr_mac_clean_cellgroup(NR_CellGroupConfig_t *cell_group)
{ {
DevAssert(cell_group != NULL);
/* remove a reconfigurationWithSync, we don't need it anymore */ /* remove a reconfigurationWithSync, we don't need it anymore */
if (cell_group->spCellConfig->reconfigurationWithSync != NULL) { if (cell_group->spCellConfig && cell_group->spCellConfig->reconfigurationWithSync != NULL) {
ASN_STRUCT_FREE(asn_DEF_NR_ReconfigurationWithSync, cell_group->spCellConfig->reconfigurationWithSync); ASN_STRUCT_FREE(asn_DEF_NR_ReconfigurationWithSync, cell_group->spCellConfig->reconfigurationWithSync);
cell_group->spCellConfig->reconfigurationWithSync = NULL; cell_group->spCellConfig->reconfigurationWithSync = NULL;
} }
......
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