<p>laforge has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/16927">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">osmo_libusb: Check return of libusb_get_string_descriptor_ascii()<br><br>Change-Id: Ifc0133737627a8277635f8f3662b3f6e922be149<br>Closes: CID#207713<br>---<br>M src/usb/osmo_libusb.c<br>1 file changed, 6 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/27/16927/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 9ad6240..7a13a7e 100644</span><br><span>--- a/src/usb/osmo_libusb.c</span><br><span>+++ b/src/usb/osmo_libusb.c</span><br><span>@@ -334,6 +334,12 @@</span><br><span> }</span><br><span> rc = libusb_get_string_descriptor_ascii(devh, dev_desc.iSerialNumber,</span><br><span> (uint8_t *) strbuf, sizeof(strbuf));</span><br><span style="color: hsl(120, 100%, 40%);">+ if (rc < 0) {</span><br><span style="color: hsl(120, 100%, 40%);">+ LOGP(DLUSB, LOGL_ERROR, "Cannot read USB Descriptor: %s\n",</span><br><span style="color: hsl(120, 100%, 40%);">+ libusb_strerror(rc));</span><br><span style="color: hsl(120, 100%, 40%);">+ libusb_close(devh);</span><br><span style="color: hsl(120, 100%, 40%);">+ continue;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> libusb_close(devh);</span><br><span> if (strcmp(strbuf, serial))</span><br><span> continue;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/16927">change 16927</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/+/16927"/><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: Ifc0133737627a8277635f8f3662b3f6e922be149 </div>
<div style="display:none"> Gerrit-Change-Number: 16927 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>