<p>pespin has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-bts/+/25966">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">scheduler: Avoid crash upon call to trx_sched_set_lchan if l1ts is uninitialized<br><br>It could happen if for instance l1 code called trx_sched_clean() when<br>closing the phy, and after that some code called (erroneously)<br>trx_sched_set_lchan(). Let's make sure we don't allow other modules to<br>crash the process when using this function.<br><br>Related: SYS#4971<br>Change-Id: I93af7c3dcf0e34e9317eec0ee183dbf18b8d2f3b<br>---<br>M src/common/scheduler.c<br>1 file changed, 6 insertions(+), 0 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/66/25966/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/common/scheduler.c b/src/common/scheduler.c</span><br><span>index c068ea0..0388445 100644</span><br><span>--- a/src/common/scheduler.c</span><br><span>+++ b/src/common/scheduler.c</span><br><span>@@ -1085,6 +1085,12 @@</span><br><span>    bool found = false;</span><br><span>  int i;</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+    if (!l1ts) {</span><br><span style="color: hsl(120, 100%, 40%);">+          LOGPLCHAN(lchan, DL1C, LOGL_ERROR, "%s lchan with uninitialized scheduler structure\n",</span><br><span style="color: hsl(120, 100%, 40%);">+                       (active) ? "Activating" : "Deactivating");</span><br><span style="color: hsl(120, 100%, 40%);">+              return -EINVAL;</span><br><span style="color: hsl(120, 100%, 40%);">+       }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>  /* VAMOS: convert Osmocom specific channel number to a generic one,</span><br><span>   * otherwise we won't match anything in trx_chan_desc[]. */</span><br><span>      if (lchan->ts->vamos.is_shadow)</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bts/+/25966">change 25966</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/+/25966"/><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: I93af7c3dcf0e34e9317eec0ee183dbf18b8d2f3b </div>
<div style="display:none"> Gerrit-Change-Number: 25966 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>