From dc934803060fbec758e8d9e5a9017cf3f701cdc9 Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Sat, 3 Dec 2011 16:19:07 +0000 Subject: [PATCH] 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 --- lib/libusb/libusb10.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/libusb/libusb10.c b/lib/libusb/libusb10.c index 0a7c1e6b157c..f1b95d68b265 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; } }