Change in osmo-bts[master]: Add new gsm_bts_trx_free_shadow_ts() function

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/.

pespin gerrit-no-reply at lists.osmocom.org
Mon Oct 11 17:23:20 UTC 2021


pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/25740 )

Change subject: Add new gsm_bts_trx_free_shadow_ts() function
......................................................................

Add new gsm_bts_trx_free_shadow_ts() function

Use it as a counterpart of gsm_bts_trx_init_shadow_ts()

Change-Id: I38baa2b2cfcf6221325d45860b3c7dd53235b8ff
---
M include/osmo-bts/bts_trx.h
M src/common/bts_trx.c
M src/common/scheduler.c
3 files changed, 18 insertions(+), 3 deletions(-)

Approvals:
  Jenkins Builder: Verified
  osmith: Looks good to me, but someone else must approve
  fixeria: Looks good to me, approved



diff --git a/include/osmo-bts/bts_trx.h b/include/osmo-bts/bts_trx.h
index e1959c8..c0dcb1c 100644
--- a/include/osmo-bts/bts_trx.h
+++ b/include/osmo-bts/bts_trx.h
@@ -50,6 +50,7 @@
 struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts);
 struct gsm_bts_trx *gsm_bts_trx_num(const struct gsm_bts *bts, int num);
 void gsm_bts_trx_init_shadow_ts(struct gsm_bts_trx *trx);
+void gsm_bts_trx_free_shadow_ts(struct gsm_bts_trx *trx);
 char *gsm_trx_name(const struct gsm_bts_trx *trx);
 const char *gsm_trx_unit_id(struct gsm_bts_trx *trx);
 
diff --git a/src/common/bts_trx.c b/src/common/bts_trx.c
index 7ef5b52..b16a31c 100644
--- a/src/common/bts_trx.c
+++ b/src/common/bts_trx.c
@@ -112,6 +112,20 @@
 	}
 }
 
+void gsm_bts_trx_free_shadow_ts(struct gsm_bts_trx *trx)
+{
+	unsigned int tn;
+
+	for (tn = 0; tn < ARRAY_SIZE(trx->ts); tn++) {
+		struct gsm_bts_trx_ts *shadow_ts = trx->ts[tn].vamos.peer;
+		if (!shadow_ts)
+			continue;
+
+		talloc_free(shadow_ts);
+		trx->ts[tn].vamos.peer = NULL;
+	}
+}
+
 struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts)
 {
 	struct gsm_bts_trx *trx = talloc_zero(bts, struct gsm_bts_trx);
diff --git a/src/common/scheduler.c b/src/common/scheduler.c
index 5118904..2a729e4 100644
--- a/src/common/scheduler.c
+++ b/src/common/scheduler.c
@@ -694,10 +694,10 @@
 		/* Clean primary and shadow timeslots */
 		trx_sched_clean_ts(ts);
 		trx_sched_clean_ts(ts->vamos.peer);
-
-		talloc_free(ts->vamos.peer);
-		ts->vamos.peer = NULL;
 	}
+
+	/* Free previously allocated shadow timeslots */
+	gsm_bts_trx_free_shadow_ts(trx);
 }
 
 struct msgb *_sched_dequeue_prim(struct l1sched_ts *l1ts, const struct trx_dl_burst_req *br)

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/25740
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I38baa2b2cfcf6221325d45860b3c7dd53235b8ff
Gerrit-Change-Number: 25740
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211011/c740ed1c/attachment.htm>


More information about the gerrit-log mailing list