From: lal.harshita Date: Wed, 14 Dec 2022 16:14:15 +0000 (+0530) Subject: [Epic-ID: ODUHIGH-464][Task-ID: ODUHIGH-483]Handling of issue related to K0 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?p=o-du%2Fl2.git;a=commitdiff_plain;h=d0832518343c8ab3cee2f0c922c204771295e8fd [Epic-ID: ODUHIGH-464][Task-ID: ODUHIGH-483]Handling of issue related to K0 pointers Signed-off-by: lal.harshita Change-Id: I7f054203a1726caf0fe01a409c9cca2aaac936e0 Signed-off-by: lal.harshita --- diff --git a/src/du_app/du_f1ap_msg_hdl.c b/src/du_app/du_f1ap_msg_hdl.c index 170bb65b8..292b5c7b0 100644 --- a/src/du_app/du_f1ap_msg_hdl.c +++ b/src/du_app/du_f1ap_msg_hdl.c @@ -4083,14 +4083,16 @@ elementCnt = pdschCfg->numTimeDomRsrcAlloc; for(idx = 0; idx < elementCnt; idx++) { timeDomAlloc = timeDomAllocList->choice.setup->list.array[idx]; - DU_ALLOC(timeDomAlloc->k0, sizeof(long)); - if(!timeDomAlloc->k0) - { - DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPdschTimeDomAllocList"); - return RFAILED; - } if(pdschCfg->timeDomRsrcAllociList[idx].k0) + { + DU_ALLOC(timeDomAlloc->k0, sizeof(long)); + if(!timeDomAlloc->k0) + { + DU_LOG("\nERROR --> F1AP : Memory allocation failed in BuildPdschTimeDomAllocList"); + return RFAILED; + } *(timeDomAlloc->k0) = *(pdschCfg->timeDomRsrcAllociList[idx].k0); + } timeDomAlloc->mappingType = pdschCfg->timeDomRsrcAllociList[idx].mappingType; timeDomAlloc->startSymbolAndLength = pdschCfg->timeDomRsrcAllociList[idx].startSymbolAndLength; } diff --git a/src/du_app/du_ue_mgr.c b/src/du_app/du_ue_mgr.c index aae867745..914b07d18 100644 --- a/src/du_app/du_ue_mgr.c +++ b/src/du_app/du_ue_mgr.c @@ -2134,30 +2134,28 @@ uint8_t DuProcMacRachRsrcRsp(Pst *pst, MacRachRsrcRsp *rachRsrcRsp) * * ****************************************************************/ -uint8_t fillK0Values(Bool toUpdate, PdschConfig *cuPdschCfg, PdschConfig *storePdschCfg) +uint8_t fillK0Values(PdschConfig *cuPdschCfg, PdschConfig *storePdschCfg) { uint8_t numTimeDomRsrcAlloc, rsrcIdx; - if(toUpdate) + if(cuPdschCfg) { - if(cuPdschCfg) + if(storePdschCfg->numTimeDomRsrcAlloc) { - if(storePdschCfg->numTimeDomRsrcAlloc) + numTimeDomRsrcAlloc = cuPdschCfg->numTimeDomRsrcAlloc; + for(rsrcIdx =0 ; rsrcIdxnumTimeDomRsrcAlloc; - for(rsrcIdx =0 ; rsrcIdxtimeDomRsrcAllociList[rsrcIdx].k0) { - if(cuPdschCfg->timeDomRsrcAllociList[rsrcIdx].k0) + if(storePdschCfg->timeDomRsrcAllociList[rsrcIdx].k0) { - if(storePdschCfg->timeDomRsrcAllociList[rsrcIdx].k0) - { - *(storePdschCfg->timeDomRsrcAllociList[rsrcIdx].k0) = *(cuPdschCfg->timeDomRsrcAllociList[rsrcIdx].k0); + *(storePdschCfg->timeDomRsrcAllociList[rsrcIdx].k0) = *(cuPdschCfg->timeDomRsrcAllociList[rsrcIdx].k0); + if(storePdschCfg->timeDomRsrcAllociList[rsrcIdx].k0 != cuPdschCfg->timeDomRsrcAllociList[rsrcIdx].k0) DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, cuPdschCfg->timeDomRsrcAllociList[rsrcIdx].k0, sizeof(uint8_t)); - } - else - { - (storePdschCfg->timeDomRsrcAllociList[rsrcIdx].k0) = (cuPdschCfg->timeDomRsrcAllociList[rsrcIdx].k0); - } + } + else + { + (storePdschCfg->timeDomRsrcAllociList[rsrcIdx].k0) = (cuPdschCfg->timeDomRsrcAllociList[rsrcIdx].k0); } } } @@ -2205,7 +2203,7 @@ uint8_t duUpdateMacCfg(DuMacUeCfg *macUeCfg, F1UeContextSetupDb *f1UeDb) if(macUeCfg->spCellCfg.servCellCfg.initDlBwp.pdschPresent) { /* update k0 values */ - fillK0Values(true, &f1UeDb->duUeCfg.copyOfmacUeCfg.spCellCfg.servCellCfg.initDlBwp.pdschCfg, &macUeCfg->spCellCfg.servCellCfg.initDlBwp.pdschCfg); + fillK0Values(&f1UeDb->duUeCfg.copyOfmacUeCfg.spCellCfg.servCellCfg.initDlBwp.pdschCfg, &macUeCfg->spCellCfg.servCellCfg.initDlBwp.pdschCfg); fillStartSymbolAndLen(macUeCfg->spCellCfg.servCellCfg.initDlBwp.pdschCfg.numTimeDomRsrcAlloc,\ &macUeCfg->spCellCfg.servCellCfg.initDlBwp.pdschCfg, NULL); }