X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fdevice.c;fp=src%2Fdevice.c;h=519a1726399b060719df6c43f2432900266e3273;hb=6c1a76d1263403f908ac31271a4fd01792488545;hp=6fcad410f2bc3802f979f7bb2f9687b755861940;hpb=7bbe5a2b6a3cea7bc5b59ca3c34ed4f6fcf8c3b1;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; }