<p>lynxis lazus has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/25323">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">gprs_ns2: gprs_ns2_free_bind() should remove itself before removing nsvcs<br><br>When removing NSVCs before removing the bind from the SNS list, the removing NSVCs could<br>trigger a creation of a new NSVC on the same bind ending in a<br>while(true) loop.<br><br>Change-Id: I6f497348f75fb479427d8a4c23313e33fbc62036<br>---<br>M src/gb/gprs_ns2.c<br>1 file changed, 6 insertions(+), 6 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/23/25323/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/gb/gprs_ns2.c b/src/gb/gprs_ns2.c</span><br><span>index 3284cd6..417b9a0 100644</span><br><span>--- a/src/gb/gprs_ns2.c</span><br><span>+++ b/src/gb/gprs_ns2.c</span><br><span>@@ -1485,18 +1485,18 @@</span><br><span>          return;</span><br><span>      bind->freed = true;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-      /* prevent recursive free() because of events user/fsm */</span><br><span style="color: hsl(0, 100%, 40%);">-       while (!llist_empty(&bind->nsvc)) {</span><br><span style="color: hsl(0, 100%, 40%);">-              nsvc = llist_first_entry(&bind->nsvc, struct gprs_ns2_vc, blist);</span><br><span style="color: hsl(0, 100%, 40%);">-                gprs_ns2_free_nsvc(nsvc);</span><br><span style="color: hsl(0, 100%, 40%);">-       }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span>    if (gprs_ns2_is_ip_bind(bind)) {</span><br><span>             llist_for_each_entry(nse, &bind->nsi->nse, list) {</span><br><span>                         gprs_ns2_sns_del_bind(nse, bind);</span><br><span>            }</span><br><span>    }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ /* prevent recursive free() because of events user/fsm */</span><br><span style="color: hsl(120, 100%, 40%);">+     while (!llist_empty(&bind->nsvc)) {</span><br><span style="color: hsl(120, 100%, 40%);">+            nsvc = llist_first_entry(&bind->nsvc, struct gprs_ns2_vc, blist);</span><br><span style="color: hsl(120, 100%, 40%);">+              gprs_ns2_free_nsvc(nsvc);</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>  if (bind->driver->free_bind)</span><br><span>           bind->driver->free_bind(bind);</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/25323">change 25323</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/libosmocore/+/25323"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I6f497348f75fb479427d8a4c23313e33fbc62036 </div>
<div style="display:none"> Gerrit-Change-Number: 25323 </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>