<p>lynxis lazus has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/libosmo-abis/+/15387">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">ipa: ipa_server_link_close() add checks of link state<br><br>When closing a link which failed on open,<br>ipa_server_link_close() would crash it when calling osmo_fd_unregister.<br><br>Change-Id: I672d4de25464c3829b08aff26b1a6d4ad92e7684<br>---<br>M src/input/ipa.c<br>1 file changed, 6 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/87/15387/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/input/ipa.c b/src/input/ipa.c</span><br><span>index 8aed7b3..c05ab04 100644</span><br><span>--- a/src/input/ipa.c</span><br><span>+++ b/src/input/ipa.c</span><br><span>@@ -333,8 +333,12 @@</span><br><span> </span><br><span> void ipa_server_link_close(struct ipa_server_link *link)</span><br><span> {</span><br><span style="color: hsl(0, 100%, 40%);">-       osmo_fd_unregister(&link->ofd);</span><br><span style="color: hsl(0, 100%, 40%);">-  close(link->ofd.fd);</span><br><span style="color: hsl(120, 100%, 40%);">+       if (osmo_fd_is_registered(&link->ofd))</span><br><span style="color: hsl(120, 100%, 40%);">+         osmo_fd_unregister(&link->ofd);</span><br><span style="color: hsl(120, 100%, 40%);">+        if (link->ofd.fd < 0)</span><br><span style="color: hsl(120, 100%, 40%);">+           close(link->ofd.fd);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     link->ofd.fd = -1;</span><br><span> }</span><br><span> </span><br><span> static int ipa_server_conn_read(struct ipa_server_conn *conn)</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmo-abis/+/15387">change 15387</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/libosmo-abis/+/15387"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmo-abis </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I672d4de25464c3829b08aff26b1a6d4ad92e7684 </div>
<div style="display:none"> Gerrit-Change-Number: 15387 </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>