X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrmac%2Fmac_slot_ind.c;h=7949523879bba8bede58962e8c35435369ce390e;hb=51bd2af5867794ba058365581a7ad3c2eba0d1c3;hp=8f686b3f76422600a8765fc5b78944f784ba9272;hpb=4ddb1fd0352946fad68e3abfd780f7ebc51dd552;p=o-du%2Fl2.git diff --git a/src/5gnrmac/mac_slot_ind.c b/src/5gnrmac/mac_slot_ind.c index 8f686b3f7..794952387 100644 --- a/src/5gnrmac/mac_slot_ind.c +++ b/src/5gnrmac/mac_slot_ind.c @@ -131,13 +131,21 @@ int MacProcDlAlloc(Pst *pst, DlSchedInfo *dlSchedInfo) macMuxPdu(&msg4DlData, &macCeData, macCb.macCell->macRaCb[0].msg4TbSize); /* storing msg4 Pdu in macDlSlot */ - MAC_ALLOC(msg4Alloc->msg4Info.msg4Pdu, macCb.macCell->macRaCb[0].msg4PduLen); - if(msg4Alloc->msg4Info.msg4Pdu != NULLP) - { - msg4Alloc->msg4Info.msg4Pdu = macCb.macCell->macRaCb[0].msg4Pdu; - msg4Alloc->msg4Info.msg4PduLen = macCb.macCell->macRaCb[0].msg4PduLen; - } - + if(macCb.macCell->macRaCb[0].msg4TxPdu) + { + msg4Alloc->msg4Info.msg4PduLen = macCb.macCell->macRaCb[0].msg4TbSize; + MAC_ALLOC(msg4Alloc->msg4Info.msg4Pdu, msg4Alloc->msg4Info.msg4PduLen); + if(msg4Alloc->msg4Info.msg4Pdu != NULLP) + { + memcpy(msg4Alloc->msg4Info.msg4Pdu, macCb.macCell->macRaCb[0].msg4TxPdu, \ + msg4Alloc->msg4Info.msg4PduLen); + } + } + else + { + DU_LOG("\nMAC: Failed at macMuxPdu()"); + return RFAILED; + } /* TODO: Free all allocated memory, after the usage */ /* MAC_FREE(macCb.macCell->macRaCb[0].msg4TxPdu, \ macCb.macCell->macRaCb[0].msg4TbSize); // TODO: To be freed after re-transmission is successful.