<p>lynxis lazus has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/20083">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">osmo-bsc: fix a crash when receiving a RACH LOAD IND with 0<br><br>Change-Id: Ia395d4ec70107688856ef0cd5daa6124a7da834b<br>---<br>M src/osmo-bsc/abis_rsl.c<br>1 file changed, 8 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/83/20083/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c</span><br><span>index 74cc760..550de06 100644</span><br><span>--- a/src/osmo-bsc/abis_rsl.c</span><br><span>+++ b/src/osmo-bsc/abis_rsl.c</span><br><span>@@ -1713,8 +1713,14 @@</span><br><span>                       sd.rach_busy_count = rslh->data[4] << 8 | rslh->data[5];</span><br><span>                         sd.rach_access_count = rslh->data[6] << 8 | rslh->data[7];</span><br><span>                       /* update stats group */</span><br><span style="color: hsl(0, 100%, 40%);">-                        busy_percent = (int32_t) sd.rach_busy_count * 100 / (int32_t) sd.rach_slot_count;</span><br><span style="color: hsl(0, 100%, 40%);">-                       access_percent = (int32_t) sd.rach_access_count * 100 / (int32_t) sd.rach_slot_count;</span><br><span style="color: hsl(120, 100%, 40%);">+                 if (sd.rach_slot_count) {</span><br><span style="color: hsl(120, 100%, 40%);">+                             access_percent = (int32_t) sd.rach_access_count * 100 / (int32_t) sd.rach_slot_count;</span><br><span style="color: hsl(120, 100%, 40%);">+                         busy_percent = (int32_t) sd.rach_busy_count * 100 / (int32_t) sd.rach_slot_count;</span><br><span style="color: hsl(120, 100%, 40%);">+                     } else {</span><br><span style="color: hsl(120, 100%, 40%);">+                              access_percent = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+                           busy_percent = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+                     }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>                  osmo_stat_item_set(sd.bts->bts_statg->items[BTS_STAT_RACH_BUSY], busy_percent);</span><br><span>                        osmo_stat_item_set(sd.bts->bts_statg->items[BTS_STAT_RACH_ACCESS], access_percent);</span><br><span>                    /* dispatch signal */</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bsc/+/20083">change 20083</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-bsc/+/20083"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bsc </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ia395d4ec70107688856ef0cd5daa6124a7da834b </div>
<div style="display:none"> Gerrit-Change-Number: 20083 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: lynxis lazus <lynxis@fe80.eu> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>