diff options
author | hselasky <hselasky@FreeBSD.org> | 2011-12-03 16:19:07 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2011-12-03 16:19:07 +0000 |
commit | fe7036d97d6db0c265b31a2ed29c141ec4848970 (patch) | |
tree | 0bf8be3e4e84f8adf5992d463458cedd3c3b8d1c /lib | |
parent | 5829cbdab5c5110053c13dad16491c4401ea512c (diff) | |
download | FreeBSD-src-fe7036d97d6db0c265b31a2ed29c141ec4848970.zip FreeBSD-src-fe7036d97d6db0c265b31a2ed29c141ec4848970.tar.gz |
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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libusb/libusb10.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/libusb/libusb10.c b/lib/libusb/libusb10.c index 0a7c1e6..f1b95d6 100644 --- a/lib/libusb/libusb10.c +++ b/lib/libusb/libusb10.c @@ -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; } } |