X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrrlc%2Frlc_stats.c;h=782bc1a4e79cf5478c817cff6552a7419b501b8f;hb=bd2905b5f651349abafb7934a952414d7c24e291;hp=c01228d84cf23373f7753efe7edd5697f4e97934;hpb=be872311899d115fdf4565e4811cc8b37226ac53;p=o-du%2Fl2.git diff --git a/src/5gnrrlc/rlc_stats.c b/src/5gnrrlc/rlc_stats.c index c01228d84..782bc1a4e 100755 --- a/src/5gnrrlc/rlc_stats.c +++ b/src/5gnrrlc/rlc_stats.c @@ -68,21 +68,23 @@ CmLListCp inUseL2UeStatsLst;/*!< In Use Pool of UE stats Blocks */ * * */ -Void TSL2AllocStatsMem(Region region,Pool pool) +Void TSL2AllocStatsMem(Inst inst) { uint32_t cnt=0; + RlcCb *gCb; + gCb = RLC_GET_RLCCB(inst); cmLListInit(&inUseL2UeStatsLst); cmLListInit(&freeL2UeStatsLst); for (cnt=0; cnt < L2_STATS_MAX_CELLS; cnt++) { if(NULL == l2CellStats[cnt]) { - if (SGetSBuf(region, pool, (Data **)&l2CellStats[cnt], - (Size)sizeof (TSL2CellStatsCb)) != ROK) - { - DU_LOG("\nERROR --> RLC : STATS Unexpected MEM Alloc Failure\n"); - } + RLC_ALLOC(gCb, l2CellStats[cnt], (Size)sizeof (TSL2CellStatsCb)); + if(l2CellStats[cnt] == NULL) + { + DU_LOG("\nERROR --> RLC : STATS Unexpected MEM Alloc Failure\n"); + } } memset(l2CellStats[cnt], 0x00, sizeof(TSL2CellStatsCb)); } @@ -92,11 +94,11 @@ Void TSL2AllocStatsMem(Region region,Pool pool) TSL2UeStatsCb *statsCb = l2UeStats[cnt]; if(NULL == statsCb) { - if (SGetSBuf(region, pool, (Data **)&statsCb, - (Size)sizeof (TSL2UeStatsCb)) != ROK) - { - DU_LOG("\nERROR --> RLC : STATS Unexpected MEM Alloc Failure at %d\n", (int)cnt); - } + RLC_ALLOC(gCb, statsCb, (Size)sizeof (TSL2UeStatsCb)); + if(NULL == statsCb) + { + DU_LOG("\nERROR --> RLC : STATS Unexpected MEM Alloc Failure at %d\n", (int)cnt); + } } memset(statsCb, 0x00, sizeof(TSL2UeStatsCb)); statsCb->lnk.node = (PTR)statsCb;