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.
This commit is contained in:
Robert Schmidt
2024-11-15 15:37:03 +01:00
parent a319cbfb19
commit 268d409b5b
@@ -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)
{
DevAssert(cell_group != NULL);
/* 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);
cell_group->spCellConfig->reconfigurationWithSync = NULL;
}