Change in osmocom-bb[master]: common/sim.c: use msgb_get() in gsm_sim_reply()

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Sun Feb 3 11:26:42 UTC 2019


Vadim Yanitskiy has submitted this change and it was merged. ( https://gerrit.osmocom.org/12786 )

Change subject: common/sim.c: use msgb_get() in gsm_sim_reply()
......................................................................

common/sim.c: use msgb_get() in gsm_sim_reply()

Change-Id: Ie5843c8adafc37da0d69c335c97b422552b85049
---
M src/host/layer23/src/common/sim.c
1 file changed, 1 insertion(+), 5 deletions(-)

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



diff --git a/src/host/layer23/src/common/sim.c b/src/host/layer23/src/common/sim.c
index f214e67..2c6c83c 100644
--- a/src/host/layer23/src/common/sim.c
+++ b/src/host/layer23/src/common/sim.c
@@ -146,7 +146,6 @@
 	struct gsm_sim *sim = &ms->sim;
 	struct msgb *msg = sim->job_msg;
 	struct sim_hdr *sh;
-	uint16_t payload_len;
 	struct gsm_sim_handler *handler;
 
 	LOGP(DSIM, LOGL_INFO, "sending result to callback function "
@@ -164,11 +163,8 @@
 		return;
 	}
 
-	payload_len = msg->len - sizeof(*sh);
-
 	/* remove data */
-	msg->tail -= payload_len;
-	msg->len -= payload_len;
+	msgb_get(msg, msg->len - sizeof(*sh));
 
 	/* add reply data */
 	sh->job_type = result_type;

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie5843c8adafc37da0d69c335c97b422552b85049
Gerrit-Change-Number: 12786
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190203/06b9e653/attachment.htm>


More information about the gerrit-log mailing list