X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrsch%2Frg_sch_utl.c;h=0e0e037298f6fa77c262b2c4a0865233eb1343d3;hb=d0832518343c8ab3cee2f0c922c204771295e8fd;hp=cdeee4009c86ae99cc34ee19b6385adfe148e0c1;hpb=ed533e7bdc5f0681bc5a731b81f354f6b2c0f79b;p=o-du%2Fl2.git diff --git a/src/5gnrsch/rg_sch_utl.c b/src/5gnrsch/rg_sch_utl.c index cdeee4009..0e0e03729 100755 --- a/src/5gnrsch/rg_sch_utl.c +++ b/src/5gnrsch/rg_sch_utl.c @@ -38,14 +38,13 @@ #include "lrg.h" #include "rgr.h" #include "tfu.h" +#include "sch_utils.h" #include "rg_env.h" #include "rg_sch_err.h" #include "rg_sch_inf.h" #include "rg_sch.h" #include "rg_sch_cmn.h" #include "rgm.h" -#include "rl_interface.h" -#include "rl_common.h" /* header/extern include files (.x) */ #include "tfu.x" /* TFU types */ @@ -3991,8 +3990,8 @@ Size size /* size */ #ifdef MS_MBUF_CORRUPTION /* Should be enabled when debugging mbuf corruption */ MS_BUF_ADD_ALLOC_CALLER(); #endif /* */ - if (SGetSBuf(rgSchCb[inst].rgSchInit.region, rgSchCb[inst].rgSchInit.pool, - pData, size) != ROK) + SCH_ALLOC(pData, size); + if(pData == NULLP) { RgUstaDgn dgn; /* Alarm diagnostics structure */ dgn.type = LRG_USTA_DGNVAL_MEM; @@ -4035,8 +4034,6 @@ Size size /* size */ ) { - S16 ret; - if ((data == NULLP) || (*data == NULLP) || (size == 0)) { return; @@ -4047,10 +4044,9 @@ Size size /* size */ MS_BUF_ADD_CALLER(); #endif /* */ /* Deallocate buffer */ - ret = SPutSBuf(rgSchCb[inst].rgSchInit.region, - rgSchCb[inst].rgSchInit.pool, (*data), size); + SCH_FREE((*data), size); - if (ret != ROK) + if (data ==NULLP) { DU_LOG("\nERROR --> SCH : rgSCHUtlFreeSBuf failed"); return; @@ -4087,7 +4083,7 @@ Void rgSCHUtlFreeWarningSiSeg(Region reg,Pool pool,CmLListCp *siPduLst) pdu = (Buffer *)node->node; cmLListDelFrm(siPduLst, node); RGSCH_FREE_MSG(pdu); - SPutSBuf(reg, pool, (Data *)node,sizeof(CmLList)); + SCH_FREE(node,sizeof(CmLList)); node = NULLP; } @@ -8333,10 +8329,10 @@ S16 rgSCHUtlUpdAvgPrbUsage(RgSchCellCb *cell) numUlSf = cell->prbUsage.rprtPeriod; #endif - if(SGetSBuf(cell->rgmSap->sapCfg.sapPst.region, - cell->rgmSap->sapCfg.sapPst.pool, (Data**)&prbRprtInd, - sizeof(RgmPrbRprtInd)) != ROK) + SCH_ALLOC(prbRprtInd, sizeof(RgmPrbRprtInd)); + if(prbRprtInd == NULLP) { + DU_LOG("\nERROR --> SCH : Failed to allocate memory for prbRprtInd"); return RFAILED; }