[Epic-ID: ODUHIGH-464][Task-ID: ODUHIGH-483] Memeory related fix in FDD and TDD mode
[o-du/l2.git] / src / 5gnrmac / rg_cfg.c
index 31c2ad4..e45326b 100755 (executable)
@@ -44,7 +44,7 @@
 #include "rg_env.h"       /* MAC environmental includes*/
 #include "rg.h"           /* MAC includes*/
 #include "rg_err.h"       /* MAC error includes*/
-
+#include "mac_utils.h" 
 /* header/extern include files (.x) */
 #include "rgu.x"           /* RGU types */
 #include "tfu.x"           /* RGU types */
@@ -603,7 +603,8 @@ RgErrInfo   *errInfo
    SuId       rguUlSapId = 0;
    SuId       rguDlSapId = 0;
    /* RLC SAP to allocate flowCntrlInd buffer*/
-   Pst        *pst ;
+   /* Commented below to resolve compilation warning */
+   //Pst        *pst ;
 
    errInfo->errCause = RGERR_CFG_CRG_CELL_CFG;
    
@@ -686,10 +687,15 @@ RgErrInfo   *errInfo
    rgUpdtCellCnt(inst,RG_CFG_ADD);
    errInfo->errCause = RGERR_NONE;
   
-   pst = &rgCb[inst].rguSap[rguDlSapId].sapCfg.sapPst;
+   /* Commented below to resolve compilation warning */
+   //pst = &rgCb[inst].rguSap[rguDlSapId].sapCfg.sapPst;
    /* Allocate a buffer for flowCntrlInd.*/
-   SGetSBuf(pst->region, pst->pool, (Data **)&cell->flowCntrlInd, 
-              sizeof(RguFlowCntrlInd));
+   MAC_ALLOC(cell->flowCntrlInd, sizeof(RguFlowCntrlInd));
+   if(cell->flowCntrlInd == NULLP)
+   {
+      DU_LOG("ERROR  --> MAC : rgCFGCrgCellCfg(): Memory allocation failed");
+      return RFAILED;
+   }
    return ROK;
 }  /* rgCFGCrgCellCfg */