Change in osmo-bts[master]: osmo-bts-trx: return -ENODEV if 'bursts_p' is NULL

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

fixeria gerrit-no-reply at lists.osmocom.org
Fri Sep 24 18:39:20 UTC 2021


fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/25578 )


Change subject: osmo-bts-trx: return -ENODEV if 'bursts_p' is NULL
......................................................................

osmo-bts-trx: return -ENODEV if 'bursts_p' is NULL

In functions responsible for Downlink burst scheduling, it may happen
that the buffer, containing a complete set of to be transmitted bursts,
a) is not yet allocated or b) was de-allocated intentionally.  In this
case, we return early to avoid NULL pointer dereference.  The returned
value is then checked against 0 in _sched_dl_burst().

Returning 0 makes _sched_dl_burst() apply per-burst attenuation, as
well as the A5/x encryption (if enabled).  And this makes no sense
in either of the cases mentioned above.

Moreover, in the BCCH power reduction mode, this causes some bursts
(bid > 0) of idle PDTCH/PTCCH blocks to be transmitted at full power,
breaking the energy saving feature.

Change-Id: I18aa73cc950fdfac030b63f7a434a71b4596095d
Related: SYS#4919
---
M src/osmo-bts-trx/sched_lchan_pdtch.c
M src/osmo-bts-trx/sched_lchan_tchf.c
M src/osmo-bts-trx/sched_lchan_tchh.c
M src/osmo-bts-trx/sched_lchan_xcch.c
4 files changed, 4 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/78/25578/1

diff --git a/src/osmo-bts-trx/sched_lchan_pdtch.c b/src/osmo-bts-trx/sched_lchan_pdtch.c
index 335ba6f..17523e1 100644
--- a/src/osmo-bts-trx/sched_lchan_pdtch.c
+++ b/src/osmo-bts-trx/sched_lchan_pdtch.c
@@ -155,7 +155,7 @@
 	/* send burst, if we already got a frame */
 	if (br->bid > 0) {
 		if (!*bursts_p)
-			return 0;
+			return -ENODEV;
 		goto send_burst;
 	}
 
diff --git a/src/osmo-bts-trx/sched_lchan_tchf.c b/src/osmo-bts-trx/sched_lchan_tchf.c
index 4bd0756..85fe207 100644
--- a/src/osmo-bts-trx/sched_lchan_tchf.c
+++ b/src/osmo-bts-trx/sched_lchan_tchf.c
@@ -514,7 +514,7 @@
 	/* send burst, if we already got a frame */
 	if (br->bid > 0) {
 		if (!*bursts_p)
-			return 0;
+			return -ENODEV;
 		goto send_burst;
 	}
 
diff --git a/src/osmo-bts-trx/sched_lchan_tchh.c b/src/osmo-bts-trx/sched_lchan_tchh.c
index a582f92..a1ed996 100644
--- a/src/osmo-bts-trx/sched_lchan_tchh.c
+++ b/src/osmo-bts-trx/sched_lchan_tchh.c
@@ -395,7 +395,7 @@
 	/* send burst, if we already got a frame */
 	if (br->bid > 0) {
 		if (!*bursts_p)
-			return 0;
+			return -ENODEV;
 		goto send_burst;
 	}
 
diff --git a/src/osmo-bts-trx/sched_lchan_xcch.c b/src/osmo-bts-trx/sched_lchan_xcch.c
index 4bfc101..e2baefd 100644
--- a/src/osmo-bts-trx/sched_lchan_xcch.c
+++ b/src/osmo-bts-trx/sched_lchan_xcch.c
@@ -176,7 +176,7 @@
 	/* send burst, if we already got a frame */
 	if (br->bid > 0) {
 		if (!*bursts_p)
-			return 0;
+			return -ENODEV;
 		goto send_burst;
 	}
 

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I18aa73cc950fdfac030b63f7a434a71b4596095d
Gerrit-Change-Number: 25578
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210924/95f1cfe5/attachment.htm>


More information about the gerrit-log mailing list