Merge "CI: Add silent cmake SonarCloud scan"
[o-du/l2.git] / src / 5gnrmac / mac_stop_ind.c
index 124565f..6238dce 100644 (file)
@@ -47,25 +47,25 @@ uint8_t sendStopIndToDuApp(uint16_t cellId)
 {
    Pst pst;
    uint8_t ret = ROK;
-   MacCellStopInfo *cellStopInd;
+   OduCellId *oduCellId;
 
    /*  Allocate sharable memory */
-   MAC_ALLOC_SHRABL_BUF(cellStopInd, sizeof(MacCellStopInfo));
-   if(!cellStopInd)
+   MAC_ALLOC_SHRABL_BUF(oduCellId, sizeof(OduCellId));
+   if(!oduCellId)
    {
-      DU_LOG("\nMAC : Stop Indication memory allocation failed");
+      DU_LOG("\nERROR  -->  MAC : Stop Indication memory allocation failed");
       return RFAILED;
    }
-   cellStopInd->cellId = cellId;
+   oduCellId->cellId = cellId;
 
    /* Fill Pst */
    FILL_PST_MAC_TO_DUAPP(pst, EVENT_MAC_STOP_IND);
 
-   ret = MacDuAppStopInd(&pst, cellStopInd);
+   ret = MacDuAppStopInd(&pst, oduCellId);
    if(ret != ROK)
    {
-      DU_LOG("\nMAC: Failed to send stop indication to DU APP");
-      MAC_FREE_SHRABL_BUF(MAC_MEM_REGION, MAC_POOL, cellStopInd, sizeof(MacCellStopInfo));
+      DU_LOG("\nERROR  -->  MAC: Failed to send stop indication to DU APP");
+      MAC_FREE_SHRABL_BUF(MAC_MEM_REGION, MAC_POOL, oduCellId, sizeof(OduCellId));
    }
    return ROK;
 }
@@ -82,10 +82,11 @@ uint8_t sendStopIndToDuApp(uint16_t cellId)
  *      -# ROK 
  *      -# RFAILED 
  ******************************************************************/
-uint8_t fapiMacStopInd(Pst *pst, uint16_t cellId) 
+uint8_t fapiMacStopInd(Pst *pst, uint16_t *cellId) 
 {
    uint8_t ret = ROK;
-   ret = sendStopIndToDuApp(cellId);
+   ret = sendStopIndToDuApp(*cellId);
+   MAC_FREE_SHRABL_BUF(pst->region, pst->pool, cellId, sizeof(uint16_t));
    return ret;
 }