get_phy_stats(): full list is non-fatal

Do not assert if the list of phy statistics is full; instead return
NULL.

In most places, this is handled appropriately (we do not store anything
if we can't). In nr_decode_pucch0(), the return value of get_phy_stats()
is used a little bit all over the function, and a constant
  if (uci_stats)
    uci_stats->variable++;
would look ugly, so make uci_stats point to the stack if we cannot store
in the phy_stats.
This commit is contained in:
Robert Schmidt
2024-03-07 09:56:20 +01:00
parent 98c309ffe3
commit 8d87f0c4e2
2 changed files with 12 additions and 4 deletions
+4 -1
View File
@@ -79,8 +79,11 @@ NR_gNB_PHY_STATS_t *get_phy_stats(PHY_VARS_gNB *gNB, uint16_t rnti)
else if (!stats->active && first_free == -1)
first_free = i;
}
if (first_free < 0)
return NULL;
// new stats
AssertFatal(first_free >= 0, "PHY statistics list is full\n");
stats = &gNB->phy_stats[first_free];
stats->active = true;
stats->rnti = rnti;