hantek-6xxx: libusb_get_device_descriptor() cannot fail.
This commit is contained in:
parent
f2a66a8ee6
commit
c940b7a32f
|
@ -206,11 +206,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((ret = libusb_get_device_descriptor(devlist[i], &des))) {
|
libusb_get_device_descriptor(devlist[i], &des);
|
||||||
sr_err("Failed to get device descriptor: %s.",
|
|
||||||
libusb_error_name(ret));
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
usb_get_port_path(devlist[i], connection_id, sizeof(connection_id));
|
usb_get_port_path(devlist[i], connection_id, sizeof(connection_id));
|
||||||
|
|
||||||
|
|
|
@ -39,11 +39,7 @@ SR_PRIV int hantek_6xxx_open(struct sr_dev_inst *sdi)
|
||||||
|
|
||||||
libusb_get_device_list(drvc->sr_ctx->libusb_ctx, &devlist);
|
libusb_get_device_list(drvc->sr_ctx->libusb_ctx, &devlist);
|
||||||
for (i = 0; devlist[i]; i++) {
|
for (i = 0; devlist[i]; i++) {
|
||||||
if ((err = libusb_get_device_descriptor(devlist[i], &des))) {
|
libusb_get_device_descriptor(devlist[i], &des);
|
||||||
sr_err("Failed to get device descriptor: %s.",
|
|
||||||
libusb_error_name(err));
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (des.idVendor != devc->profile->fw_vid
|
if (des.idVendor != devc->profile->fw_vid
|
||||||
|| des.idProduct != devc->profile->fw_pid)
|
|| des.idProduct != devc->profile->fw_pid)
|
||||||
|
|
Loading…
Reference in New Issue