X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrsch%2Frg_sch_utl.c;fp=src%2F5gnrsch%2Frg_sch_utl.c;h=f7b8ce7d3573b33166f8a2d8869f8db86e530df7;hb=284fc2e85cb5008061a7f8c6d07947a1c6209432;hp=e9a89231c3b92fcd6af4a50aeeb9518c26b6065e;hpb=377a2d180b617d4df038e1780d4a8de98d7c125f;p=o-du%2Fl2.git diff --git a/src/5gnrsch/rg_sch_utl.c b/src/5gnrsch/rg_sch_utl.c index e9a89231c..f7b8ce7d3 100755 --- a/src/5gnrsch/rg_sch_utl.c +++ b/src/5gnrsch/rg_sch_utl.c @@ -38,6 +38,7 @@ #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" @@ -3989,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; @@ -4045,10 +4046,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; @@ -4085,7 +4085,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; } @@ -8331,10 +8331,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; }