Ensure device is closed before usb_get_port_path()
The usb_get_port_path() function opens the passed device on FreeBSD, which fails if the device has already been open. This fixes bug #1109.
This commit is contained in:
parent
90cc52260c
commit
7bbe5a2b6a
|
@ -192,10 +192,10 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
|
|||
continue;
|
||||
}
|
||||
|
||||
usb_get_port_path(devlist[i], connection_id, sizeof(connection_id));
|
||||
|
||||
libusb_close(hdl);
|
||||
|
||||
usb_get_port_path(devlist[i], connection_id, sizeof(connection_id));
|
||||
|
||||
if (!strcmp(product, "ChronoVu LA8"))
|
||||
model = 0;
|
||||
else if (!strcmp(product, "ChronoVu LA16"))
|
||||
|
|
|
@ -214,10 +214,10 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
|
|||
continue;
|
||||
}
|
||||
|
||||
usb_get_port_path(devlist[i], connection_id, sizeof(connection_id));
|
||||
|
||||
libusb_close(hdl);
|
||||
|
||||
usb_get_port_path(devlist[i], connection_id, sizeof(connection_id));
|
||||
|
||||
prof = NULL;
|
||||
for (j = 0; supported_device[j].vid; j++) {
|
||||
if (des.idVendor == supported_device[j].vid &&
|
||||
|
|
|
@ -263,10 +263,10 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
|
|||
continue;
|
||||
}
|
||||
|
||||
usb_get_port_path(devlist[i], connection_id, sizeof(connection_id));
|
||||
|
||||
libusb_close(hdl);
|
||||
|
||||
usb_get_port_path(devlist[i], connection_id, sizeof(connection_id));
|
||||
|
||||
prof = NULL;
|
||||
for (j = 0; supported_fx2[j].vid; j++) {
|
||||
if (des.idVendor == supported_fx2[j].vid &&
|
||||
|
|
Loading…
Reference in New Issue