Code Review
/
o-du
/
l2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
[ JIRA Id - ODUHIGH-606 ] Fixing null memory size allocation issue
[o-du/l2.git]
/
src
/
5gnrmac
/
mac_cfg_hdl.c
diff --git
a/src/5gnrmac/mac_cfg_hdl.c
b/src/5gnrmac/mac_cfg_hdl.c
index
6b09b9a
..
b1e77b2
100644
(file)
--- a/
src/5gnrmac/mac_cfg_hdl.c
+++ b/
src/5gnrmac/mac_cfg_hdl.c
@@
-193,6
+193,10
@@
uint8_t MacProcCellCfgReq(Pst *pst, MacCellCfg *macCellCfg)
for(plmnIdx = 0; plmnIdx < MAX_PLMN; plmnIdx++)
{
macCb.macCell[cellIdx]->macCellCfg.cellCfg.plmnInfoList[plmnIdx].suppSliceList.numSupportedSlices = macCellCfg->cellCfg.plmnInfoList[plmnIdx].suppSliceList.numSupportedSlices;
for(plmnIdx = 0; plmnIdx < MAX_PLMN; plmnIdx++)
{
macCb.macCell[cellIdx]->macCellCfg.cellCfg.plmnInfoList[plmnIdx].suppSliceList.numSupportedSlices = macCellCfg->cellCfg.plmnInfoList[plmnIdx].suppSliceList.numSupportedSlices;
+
+ if(macCb.macCell[cellIdx]->macCellCfg.cellCfg.plmnInfoList[plmnIdx].suppSliceList.numSupportedSlices==0)
+ break;
+
MAC_ALLOC(macCb.macCell[cellIdx]->macCellCfg.cellCfg.plmnInfoList[plmnIdx].suppSliceList.snssai, macCb.macCell[cellIdx]->macCellCfg.cellCfg.plmnInfoList[plmnIdx].suppSliceList.numSupportedSlices\
* sizeof(Snssai*));
if(macCb.macCell[cellIdx]->macCellCfg.cellCfg.plmnInfoList[plmnIdx].suppSliceList.snssai == NULLP)
MAC_ALLOC(macCb.macCell[cellIdx]->macCellCfg.cellCfg.plmnInfoList[plmnIdx].suppSliceList.snssai, macCb.macCell[cellIdx]->macCellCfg.cellCfg.plmnInfoList[plmnIdx].suppSliceList.numSupportedSlices\
* sizeof(Snssai*));
if(macCb.macCell[cellIdx]->macCellCfg.cellCfg.plmnInfoList[plmnIdx].suppSliceList.snssai == NULLP)
@@
-778,6
+782,7
@@
void freeMacSliceCfgReq(MacSliceCfgReq *cfgReq,Pst *pst)
MAC_FREE_SHRABL_BUF(pst->region, pst->pool, cfgReq->listOfRrmPolicy, cfgReq->numOfRrmPolicy * sizeof(MacSliceRrmPolicy*));
}
}
MAC_FREE_SHRABL_BUF(pst->region, pst->pool, cfgReq->listOfRrmPolicy, cfgReq->numOfRrmPolicy * sizeof(MacSliceRrmPolicy*));
}
}
+ MAC_FREE_SHRABL_BUF(pst->region, pst->pool, cfgReq, sizeof(MacSliceCfgReq));
}
}
@@
-1058,11
+1063,6
@@
uint8_t MacSendStatsRspToDuApp(MacStatsRsp *statsRsp)
DU_LOG("\nINFO --> MAC : MacSendStatsRspToDuApp: Sending Statistics Response to DU APP");
DU_LOG("\nINFO --> MAC : MacSendStatsRspToDuApp: Sending Statistics Response to DU APP");
- /* Workaround : To skip corrupted memory, allocating a pointer that will
- * remain unused */
- uint8_t *dummyPtr = NULLP;
- MAC_ALLOC_SHRABL_BUF(dummyPtr, sizeof(uint8_t));
-
MAC_ALLOC_SHRABL_BUF(macStatsRsp, sizeof(MacStatsRsp));
if(macStatsRsp == NULLP)
{
MAC_ALLOC_SHRABL_BUF(macStatsRsp, sizeof(MacStatsRsp));
if(macStatsRsp == NULLP)
{
@@
-1084,8
+1084,6
@@
uint8_t MacSendStatsRspToDuApp(MacStatsRsp *statsRsp)
}
}
}
}
- /* Workaround : Freeing the dummy pointer */
- MAC_FREE_SHRABL_BUF(MAC_MEM_REGION, MAC_POOL, dummyPtr, sizeof(uint8_t));
return ret;
}
return ret;
}