X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fsaleae-logic16%2Fapi.c;h=ed9e1ecde9013a51d89e99c22af67f2b23c76d25;hb=2c267f6819c2bd0e6f7101ffd4eec35ef6c2a734;hp=dedb9a244a2c637e59766125d2bfd801662314f2;hpb=21fe5dba36bd388ed271b78b80df980ab13a63fd;p=libsigrok.git diff --git a/src/hardware/saleae-logic16/api.c b/src/hardware/saleae-logic16/api.c index dedb9a24..ed9e1ecd 100644 --- a/src/hardware/saleae-logic16/api.c +++ b/src/hardware/saleae-logic16/api.c @@ -188,7 +188,8 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) libusb_get_device_descriptor(devlist[i], &des); - 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; if (des.idVendor != LOGIC16_VID || des.idProduct != LOGIC16_PID) continue; @@ -266,7 +267,9 @@ static int logic16_dev_open(struct sr_dev_inst *sdi) /* * Check device by its physical USB bus/port address. */ - 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; + if (strcmp(sdi->connection_id, connection_id)) /* This is not the one. */ continue;