This function can fail. If so, do not ignore the failure.
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;
}
libusb_close(hdl);
- 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(product, "ChronoVu LA8"))
model = 0;
libusb_close(hdl);
- 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;
prof = NULL;
for (j = 0; supported_device[j].vid; j++) {
if ((sdi->status == SR_ST_INITIALIZING) ||
(sdi->status == SR_ST_INACTIVE)) {
/* 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;
libusb_close(hdl);
- 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;
prof = NULL;
for (j = 0; supported_fx2[j].vid; j++) {
/*
* 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;
des.idProduct != H4032L_USB_PRODUCT)
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;
sdi = g_malloc0(sizeof(struct sr_dev_inst));
sdi->driver = &hantek_4032l_driver_info;
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;
prof = NULL;
for (j = 0; dev_profiles[j].orig_vid; j++) {
/*
* 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;
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;
prof = NULL;
for (j = 0; dev_profiles[j].orig_vid; j++) {
/*
* 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;
if (des.idVendor != LOGICSTUDIO16_VID)
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;
usb = NULL;
des.idProduct != LOGICSTUDIO16_PID_HAVE_FIRMWARE)
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;
/*
* Check if this device is the same one that we associated
if (des.idVendor != 0x21a9 || des.idProduct != 0x1006)
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;
sdi = g_malloc0(sizeof(struct sr_dev_inst));
sdi->status = SR_ST_INITIALIZING;
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;
/*
* 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;
if (strncmp(manufacturer, "testo", 5))
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;
/* Hardcode the 435 for now. */
if (strcmp(product, "testo 435/635/735"))
if (des.idVendor != VICTOR_VID || des.idProduct != VICTOR_PID)
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;
sdi = g_malloc0(sizeof(struct sr_dev_inst));
sdi->status = SR_ST_INACTIVE;
libusb_close(hdl);
- 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;
prof = NULL;
for (j = 0; j < zeroplus_models[j].vid; j++) {