Change in osmo-msc[master]: libmsc/gsm_04_11.c: cosmetic: restructure gsm411_mm_send()

Harald Welte gerrit-no-reply at lists.osmocom.org
Sun May 12 10:09:25 UTC 2019


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/14001 )

Change subject: libmsc/gsm_04_11.c: cosmetic: restructure gsm411_mm_send()
......................................................................

libmsc/gsm_04_11.c: cosmetic: restructure gsm411_mm_send()

Change-Id: I22e99f40ab2252a0b716969091e4d24b3b4268a2
---
M src/libmsc/gsm_04_11.c
1 file changed, 2 insertions(+), 4 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c
index cc9ce18..c5c3036 100644
--- a/src/libmsc/gsm_04_11.c
+++ b/src/libmsc/gsm_04_11.c
@@ -216,22 +216,20 @@
 	switch (msg_type) {
 	case GSM411_MMSMS_EST_REQ:
 		rc = gsm411_mmsms_est_req(trans);
-		msgb_free(msg); /* upper layer does not free msg */
 		break;
 	case GSM411_MMSMS_DATA_REQ:
 		rc = gsm411_cp_sendmsg(msg, trans, cp_msg_type);
-		break;
+		return rc; /* gsm411_cp_sendmsg() takes msg ownership */
 	case GSM411_MMSMS_REL_REQ:
 		LOG_TRANS(trans, LOGL_DEBUG, "Got MMSMS_REL_REQ, destroying transaction.\n");
-		msgb_free(msg);
 		trans_free(trans);
 		break;
 	default:
 		LOG_TRANS(trans, LOGL_NOTICE, "Unhandled MMCCSMS msg 0x%x\n", msg_type);
-		msgb_free(msg);
 		rc = -EINVAL;
 	}
 
+	msgb_free(msg);
 	return rc;
 }
 

-- 
To view, visit https://gerrit.osmocom.org/14001
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I22e99f40ab2252a0b716969091e4d24b3b4268a2
Gerrit-Change-Number: 14001
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190512/c927e4bb/attachment.html>


More information about the gerrit-log mailing list