X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fdevice.c;h=519a1726399b060719df6c43f2432900266e3273;hb=187c300b59f67f23f4ae6bad3f2102b2c1ae0b28;hp=6fcad410f2bc3802f979f7bb2f9687b755861940;hpb=56c8dd821e7d8ab3602e5fd001f56d91d7b42df3;p=libsigrok.git diff --git a/src/device.c b/src/device.c index 6fcad410..519a1726 100644 --- a/src/device.c +++ b/src/device.c @@ -753,7 +753,9 @@ SR_API const char *sr_dev_inst_connid_get(const struct sr_dev_inst *sdi) if (b != usb->bus || a != usb->address) continue; - usb_get_port_path(devlist[i], connection_id, sizeof(connection_id)); + if (usb_get_port_path(devlist[i], connection_id, sizeof(connection_id)) < 0) + continue; + ((struct sr_dev_inst *)sdi)->connection_id = g_strdup(connection_id); break; }