libusb_open() sets the given device handle to NULL if it
fails, so there is no need to do it again after returning. Submitted by: Christoph Mallon MFC after: 3 days
This commit is contained in:
parent
494b6fec82
commit
dc93480306
@ -427,8 +427,7 @@ libusb_open_device_with_vid_pid(libusb_context *ctx, uint16_t vendor_id,
|
||||
*/
|
||||
if (pdesc->idVendor == vendor_id &&
|
||||
pdesc->idProduct == product_id) {
|
||||
if (libusb_open(devs[j], &pdev) < 0)
|
||||
pdev = NULL;
|
||||
libusb_open(devs[j], &pdev);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user