neels has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-iuh/+/37414?usp=email )
Change subject: ranap_cn_rx_co(): do not ranap_cn_rx_co_free() on error
......................................................................
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(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/14/37414/1
diff --git a/src/ranap_common_cn.c b/src/ranap_common_cn.c
index 26f9e69..de481d0 100644
--- a/src/ranap_common_cn.c
+++ b/src/ranap_common_cn.c
@@ -426,16 +426,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
https://gerrit.osmocom.org/c/osmo-iuh/+/37414?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: If7545f91c69f06bc32c55cab7dcfcad8350b0473
Gerrit-Change-Number: 37414
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: newchange