neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/32528 )
Change subject: less code dup in mem free of hnbgw_rx_ue_register_req() ......................................................................
less code dup in mem free of hnbgw_rx_ue_register_req()
Related: SYS#6297 Change-Id: I433127f90bf6f82baf33c516f327f84d081ad69c --- M src/osmo-hnbgw/hnbgw_hnbap.c 1 file changed, 15 insertions(+), 5 deletions(-)
Approvals: laforge: Looks good to me, approved pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified
diff --git a/src/osmo-hnbgw/hnbgw_hnbap.c b/src/osmo-hnbgw/hnbgw_hnbap.c index 980c6b0..a504e4a 100644 --- a/src/osmo-hnbgw/hnbgw_hnbap.c +++ b/src/osmo-hnbgw/hnbgw_hnbap.c @@ -518,13 +518,12 @@ else rc = hnbgw_tx_ue_register_rej_tmsi(ctx, &ies.uE_Identity); /* all has been handled by TMSI, skip the IMSI code below */ - hnbap_free_ueregisterrequesties(&ies); - return rc; + goto free_and_return_rc; default: LOGHNB(ctx, DHNBAP, LOGL_NOTICE, "UE-REGISTER-REQ with unsupported UE Id type %d\n", ies.uE_Identity.present); - hnbap_free_ueregisterrequesties(&ies); - return rc; + rc = -ENOTSUP; + goto free_and_return_rc; }
LOGHNB(ctx, DHNBAP, LOGL_DEBUG, "UE-REGISTER-REQ ID_type=%d imsi=%s cause=%ld\n", @@ -534,7 +533,6 @@ if (!ue) ue = ue_allocated = ue_context_alloc(ctx, imsi, 0);
- hnbap_free_ueregisterrequesties(&ies); /* Send UERegisterAccept */ rc = hnbgw_tx_ue_register_acc(ue); if (rc < 0) { @@ -543,6 +541,8 @@ if (ue_allocated) ue_context_free(ue_allocated); } +free_and_return_rc: + hnbap_free_ueregisterrequesties(&ies); return rc; }