Commit d9934436 authored by Xue Song's avatar Xue Song

fix some cppcheck errors

parent 84d3cfb1
...@@ -511,7 +511,7 @@ static void deliver_sdu_drb(protocol_ctxt_t *ctxt_pP,void *_ue, nr_pdcp_entity_t ...@@ -511,7 +511,7 @@ static void deliver_sdu_drb(protocol_ctxt_t *ctxt_pP,void *_ue, nr_pdcp_entity_t
nr_pdcp_ue_t *ue = _ue; nr_pdcp_ue_t *ue = _ue;
MessageDef *message_p; MessageDef *message_p;
uint8_t *gtpu_buffer_p; uint8_t *gtpu_buffer_p;
int rb_id; int rb_id = 0;
int i; int i;
if (1) { //(IS_SOFTMODEM_NOS1){ if (1) { //(IS_SOFTMODEM_NOS1){
......
...@@ -1226,7 +1226,7 @@ do_NR_DLInformationTransfer( ...@@ -1226,7 +1226,7 @@ do_NR_DLInformationTransfer(
criticalExtensions.choice.dlInformationTransfer->dedicatedNAS_Message->size = pdu_length; criticalExtensions.choice.dlInformationTransfer->dedicatedNAS_Message->size = pdu_length;
encoded = uper_encode_to_new_buffer (&asn_DEF_NR_DL_DCCH_Message, NULL, (void *) &dl_dcch_msg, (void **)buffer); encoded = uper_encode_to_new_buffer (&asn_DEF_NR_DL_DCCH_Message, NULL, (void *) &dl_dcch_msg, (void **)buffer);
AssertFatal(encoded > 0,"ASN1 message encoding failed (%s, %lu)!\n", AssertFatal(encoded > 0,"ASN1 message encoding failed (%s, %ld)!\n",
"DLInformationTransfer", encoded); "DLInformationTransfer", encoded);
LOG_D(NR_RRC,"DLInformationTransfer Encoded %zd bytes\n", encoded); LOG_D(NR_RRC,"DLInformationTransfer Encoded %zd bytes\n", encoded);
return encoded; return encoded;
...@@ -1248,7 +1248,7 @@ uint8_t do_NR_ULInformationTransfer(uint8_t **buffer, uint32_t pdu_length, uint8 ...@@ -1248,7 +1248,7 @@ uint8_t do_NR_ULInformationTransfer(uint8_t **buffer, uint32_t pdu_length, uint8
ulInformationTransfer->dedicatedNAS_Message->size = pdu_length; ulInformationTransfer->dedicatedNAS_Message->size = pdu_length;
ulInformationTransfer->lateNonCriticalExtension = NULL; ulInformationTransfer->lateNonCriticalExtension = NULL;
encoded = uper_encode_to_new_buffer (&asn_DEF_NR_UL_DCCH_Message, NULL, (void *) &ul_dcch_msg, (void **) buffer); encoded = uper_encode_to_new_buffer (&asn_DEF_NR_UL_DCCH_Message, NULL, (void *) &ul_dcch_msg, (void **) buffer);
AssertFatal(encoded > 0,"ASN1 message encoding failed (%s, %lu)!\n", AssertFatal(encoded > 0,"ASN1 message encoding failed (%s, %ld)!\n",
"ULInformationTransfer",encoded); "ULInformationTransfer",encoded);
LOG_D(NR_RRC,"ULInformationTransfer Encoded %zd bytes\n",encoded); LOG_D(NR_RRC,"ULInformationTransfer Encoded %zd bytes\n",encoded);
......
...@@ -2222,14 +2222,14 @@ rrc_ue_process_rrcReconfiguration( ...@@ -2222,14 +2222,14 @@ rrc_ue_process_rrcReconfiguration(
uint8_t msg_type = 0; uint8_t msg_type = 0;
if((pdu_buffer + 1) != NULL){ if((pdu_buffer + 1) != NULL){
if (*(pdu_buffer + 1) > 0 ) { if (*(pdu_buffer + 1) > 0 ) {
if(pdu_buffer + 9){ if((pdu_buffer + 9) != NULL){
msg_type = *(pdu_buffer + 9); msg_type = *(pdu_buffer + 9);
} else { } else {
LOG_W(NR_RRC, "[UE] Received invalid downlink message\n"); LOG_W(NR_RRC, "[UE] Received invalid downlink message\n");
return; return;
} }
} else { } else {
if(pdu_buffer + 2){ if((pdu_buffer + 2) != NULL){
msg_type = *(pdu_buffer + 2); msg_type = *(pdu_buffer + 2);
} else { } else {
LOG_W(NR_RRC, "[UE] Received invalid downlink message\n"); LOG_W(NR_RRC, "[UE] Received invalid downlink message\n");
......
...@@ -709,12 +709,12 @@ int ngap_gNB_initial_ctxt_resp( ...@@ -709,12 +709,12 @@ int ngap_gNB_initial_ctxt_resp(
ie->value.choice.RAN_UE_NGAP_ID = initial_ctxt_resp_p->gNB_ue_ngap_id; ie->value.choice.RAN_UE_NGAP_ID = initial_ctxt_resp_p->gNB_ue_ngap_id;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* optional */ /* optional */
if (initial_ctxt_resp_p->nb_of_pdusessions){
ie = (NGAP_InitialContextSetupResponseIEs_t *)calloc(1, sizeof(NGAP_InitialContextSetupResponseIEs_t)); ie = (NGAP_InitialContextSetupResponseIEs_t *)calloc(1, sizeof(NGAP_InitialContextSetupResponseIEs_t));
ie->id = NGAP_ProtocolIE_ID_id_PDUSessionResourceSetupListCxtRes; ie->id = NGAP_ProtocolIE_ID_id_PDUSessionResourceSetupListCxtRes;
ie->criticality = NGAP_Criticality_ignore; ie->criticality = NGAP_Criticality_ignore;
ie->value.present = NGAP_InitialContextSetupResponseIEs__value_PR_PDUSessionResourceSetupListCxtRes; ie->value.present = NGAP_InitialContextSetupResponseIEs__value_PR_PDUSessionResourceSetupListCxtRes;
if (initial_ctxt_resp_p->nb_of_pdusessions){
for (i = 0; i < initial_ctxt_resp_p->nb_of_pdusessions; i++) { for (i = 0; i < initial_ctxt_resp_p->nb_of_pdusessions; i++) {
NGAP_PDUSessionResourceSetupItemCxtRes_t *item; NGAP_PDUSessionResourceSetupItemCxtRes_t *item;
NGAP_PDUSessionResourceSetupResponseTransfer_t *pdusessionTransfer_p = NULL; NGAP_PDUSessionResourceSetupResponseTransfer_t *pdusessionTransfer_p = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment