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:
Hans Petter Selasky 2011-12-03 16:19:07 +00:00
parent 494b6fec82
commit dc93480306

View File

@ -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;
}
}