<p>fixeria has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/17109">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">osmo_libusb: check return value of osmo_fd_register()<br><br>Most likely, we should not assert() here, but let's at least log<br>an error message in case if osmo_fd_register() fails.<br><br>Change-Id: Ia20755ec12ee9fb0eba8322551642a96e68e1570<br>Related: CID#206572<br>---<br>M src/usb/osmo_libusb.c<br>1 file changed, 4 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/09/17109/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/usb/osmo_libusb.c b/src/usb/osmo_libusb.c</span><br><span>index 7a13a7e..3c8a22a 100644</span><br><span>--- a/src/usb/osmo_libusb.c</span><br><span>+++ b/src/usb/osmo_libusb.c</span><br><span>@@ -86,6 +86,7 @@</span><br><span>        struct osmo_fd *ofd = talloc_zero(OTC_GLOBAL, struct osmo_fd);</span><br><span>       libusb_context *luctx = user_data;</span><br><span>   unsigned int when = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+        int rc;</span><br><span> </span><br><span>  if (events & POLLIN)</span><br><span>             when |= OSMO_FD_READ;</span><br><span>@@ -93,7 +94,9 @@</span><br><span>            when |= OSMO_FD_WRITE;</span><br><span> </span><br><span>   osmo_fd_setup(ofd, fd, when, osmo_usb_fd_cb, luctx, 0);</span><br><span style="color: hsl(0, 100%, 40%);">- osmo_fd_register(ofd);</span><br><span style="color: hsl(120, 100%, 40%);">+        rc = osmo_fd_register(ofd);</span><br><span style="color: hsl(120, 100%, 40%);">+   if (rc)</span><br><span style="color: hsl(120, 100%, 40%);">+               LOGP(DLUSB, LOGL_ERROR, "osmo_fd_register() failed with rc=%d\n", rc);</span><br><span> }</span><br><span> </span><br><span> /* called by libusb if it wants to remove a file-descriptor */</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/17109">change 17109</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/+/17109"/><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: Ia20755ec12ee9fb0eba8322551642a96e68e1570 </div>
<div style="display:none"> Gerrit-Change-Number: 17109 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: fixeria <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>