laforge submitted this change.

View Change


Approvals: daniel: Looks good to me, but someone else must approve laforge: Looks good to me, approved Jenkins Builder: Verified
ranap_cn_rx_co(): do not ranap_cn_rx_co_free() on error

When ranap_cn_rx_co_decode2() returns an error, we should not call
ranap_cn_rx_co_free(). It results in logging

DRANAP INFO Freeing RANAP Procedure unknown 0x0 (CO) from RNC not implemented

Change the function flow to early-exit pattern to skip
ranap_cn_rx_co_free() on error.

Change-Id: If7545f91c69f06bc32c55cab7dcfcad8350b0473
---
M src/ranap_common_cn.c
1 file changed, 23 insertions(+), 6 deletions(-)

diff --git a/src/ranap_common_cn.c b/src/ranap_common_cn.c
index 81dcdca..8d0cc0c 100644
--- a/src/ranap_common_cn.c
+++ b/src/ranap_common_cn.c
@@ -414,16 +414,16 @@
int rc;

rc = ranap_cn_rx_co_decode2(&message, data, len);
-
- if (rc == 0)
- (*cb)(priv, &message);
- else
+ if (rc) {
LOGP(DRANAP, LOGL_ERROR, "Not calling cn_ranap_handle_co() due to rc=%d\n", rc);
+ return rc;
+ }
+
+ (*cb)(priv, &message);

/* Free the asn1 structs in message */
ranap_cn_rx_co_free(&message);
-
- return rc;
+ return 0;
}

static int cn_ranap_rx_initiating_msg_cl(RANAP_InitiatingMessage_t *imsg, ranap_message *message)

To view, visit change 37414. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: If7545f91c69f06bc32c55cab7dcfcad8350b0473
Gerrit-Change-Number: 37414
Gerrit-PatchSet: 2
Gerrit-Owner: neels <nhofmeyr@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann@sysmocom.de>
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-MessageType: merged