<p>fixeria has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-bts/+/26692">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">phy_instance_destroy(): fix NULL pointer dereference<br><br>Change-Id: Id028577ef92d1b3ce63ba62b63b8b29edb2ae5a4<br>Fixes: OS#5377<br>---<br>M src/common/phy_link.c<br>1 file changed, 6 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/92/26692/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/common/phy_link.c b/src/common/phy_link.c</span><br><span>index 5ad72ac..352d8f7 100644</span><br><span>--- a/src/common/phy_link.c</span><br><span>+++ b/src/common/phy_link.c</span><br><span>@@ -129,10 +129,12 @@</span><br><span>      /* remove from list of instances in the link */</span><br><span>      llist_del(&pinst->list);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-     /* remove reverse link from TRX */</span><br><span style="color: hsl(0, 100%, 40%);">-      OSMO_ASSERT(pinst->trx->pinst == pinst);</span><br><span style="color: hsl(0, 100%, 40%);">-  pinst->trx->pinst = NULL;</span><br><span style="color: hsl(0, 100%, 40%);">- pinst->trx = NULL;</span><br><span style="color: hsl(120, 100%, 40%);">+ /* remove reverse link from TRX (if associated) */</span><br><span style="color: hsl(120, 100%, 40%);">+    if (pinst->trx != NULL) {</span><br><span style="color: hsl(120, 100%, 40%);">+          OSMO_ASSERT(pinst->trx->pinst == pinst);</span><br><span style="color: hsl(120, 100%, 40%);">+                pinst->trx->pinst = NULL;</span><br><span style="color: hsl(120, 100%, 40%);">+               pinst->trx = NULL;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> </span><br><span>        talloc_free(pinst);</span><br><span> }</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bts/+/26692">change 26692</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/+/26692"/><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: Id028577ef92d1b3ce63ba62b63b8b29edb2ae5a4 </div>
<div style="display:none"> Gerrit-Change-Number: 26692 </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>