<p>fixeria has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-bts/+/25578">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">osmo-bts-trx: return -ENODEV if 'bursts_p' is NULL<br><br>In functions responsible for Downlink burst scheduling, it may happen<br>that the buffer, containing a complete set of to be transmitted bursts,<br>a) is not yet allocated or b) was de-allocated intentionally.  In this<br>case, we return early to avoid NULL pointer dereference.  The returned<br>value is then checked against 0 in _sched_dl_burst().<br><br>Returning 0 makes _sched_dl_burst() apply per-burst attenuation, as<br>well as the A5/x encryption (if enabled).  And this makes no sense<br>in either of the cases mentioned above.<br><br>Moreover, in the BCCH power reduction mode, this causes some bursts<br>(bid > 0) of idle PDTCH/PTCCH blocks to be transmitted at full power,<br>breaking the energy saving feature.<br><br>Change-Id: I18aa73cc950fdfac030b63f7a434a71b4596095d<br>Related: SYS#4919<br>---<br>M src/osmo-bts-trx/sched_lchan_pdtch.c<br>M src/osmo-bts-trx/sched_lchan_tchf.c<br>M src/osmo-bts-trx/sched_lchan_tchh.c<br>M src/osmo-bts-trx/sched_lchan_xcch.c<br>4 files changed, 4 insertions(+), 4 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/78/25578/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/osmo-bts-trx/sched_lchan_pdtch.c b/src/osmo-bts-trx/sched_lchan_pdtch.c</span><br><span>index 335ba6f..17523e1 100644</span><br><span>--- a/src/osmo-bts-trx/sched_lchan_pdtch.c</span><br><span>+++ b/src/osmo-bts-trx/sched_lchan_pdtch.c</span><br><span>@@ -155,7 +155,7 @@</span><br><span>   /* send burst, if we already got a frame */</span><br><span>  if (br->bid > 0) {</span><br><span>             if (!*bursts_p)</span><br><span style="color: hsl(0, 100%, 40%);">-                 return 0;</span><br><span style="color: hsl(120, 100%, 40%);">+                     return -ENODEV;</span><br><span>              goto send_burst;</span><br><span>     }</span><br><span> </span><br><span>diff --git a/src/osmo-bts-trx/sched_lchan_tchf.c b/src/osmo-bts-trx/sched_lchan_tchf.c</span><br><span>index 4bd0756..85fe207 100644</span><br><span>--- a/src/osmo-bts-trx/sched_lchan_tchf.c</span><br><span>+++ b/src/osmo-bts-trx/sched_lchan_tchf.c</span><br><span>@@ -514,7 +514,7 @@</span><br><span>         /* send burst, if we already got a frame */</span><br><span>  if (br->bid > 0) {</span><br><span>             if (!*bursts_p)</span><br><span style="color: hsl(0, 100%, 40%);">-                 return 0;</span><br><span style="color: hsl(120, 100%, 40%);">+                     return -ENODEV;</span><br><span>              goto send_burst;</span><br><span>     }</span><br><span> </span><br><span>diff --git a/src/osmo-bts-trx/sched_lchan_tchh.c b/src/osmo-bts-trx/sched_lchan_tchh.c</span><br><span>index a582f92..a1ed996 100644</span><br><span>--- a/src/osmo-bts-trx/sched_lchan_tchh.c</span><br><span>+++ b/src/osmo-bts-trx/sched_lchan_tchh.c</span><br><span>@@ -395,7 +395,7 @@</span><br><span>         /* send burst, if we already got a frame */</span><br><span>  if (br->bid > 0) {</span><br><span>             if (!*bursts_p)</span><br><span style="color: hsl(0, 100%, 40%);">-                 return 0;</span><br><span style="color: hsl(120, 100%, 40%);">+                     return -ENODEV;</span><br><span>              goto send_burst;</span><br><span>     }</span><br><span> </span><br><span>diff --git a/src/osmo-bts-trx/sched_lchan_xcch.c b/src/osmo-bts-trx/sched_lchan_xcch.c</span><br><span>index 4bfc101..e2baefd 100644</span><br><span>--- a/src/osmo-bts-trx/sched_lchan_xcch.c</span><br><span>+++ b/src/osmo-bts-trx/sched_lchan_xcch.c</span><br><span>@@ -176,7 +176,7 @@</span><br><span>         /* send burst, if we already got a frame */</span><br><span>  if (br->bid > 0) {</span><br><span>             if (!*bursts_p)</span><br><span style="color: hsl(0, 100%, 40%);">-                 return 0;</span><br><span style="color: hsl(120, 100%, 40%);">+                     return -ENODEV;</span><br><span>              goto send_burst;</span><br><span>     }</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bts/+/25578">change 25578</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-bts/+/25578"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bts </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I18aa73cc950fdfac030b63f7a434a71b4596095d </div>
<div style="display:none"> Gerrit-Change-Number: 25578 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>