diff options
| author | Sean Farley <scf@FreeBSD.org> | 2009-12-12 00:24:30 +0000 |
|---|---|---|
| committer | Sean Farley <scf@FreeBSD.org> | 2009-12-12 00:24:30 +0000 |
| commit | abdbb3fecd9babd8a2d31d2a94806a16bf9125d8 (patch) | |
| tree | d37514939301bede19eca6f8f94696847718e012 /lib/libusb | |
| parent | 0dd84a53d751ed46359f2e95b7b1fccc10479984 (diff) | |
Notes
Diffstat (limited to 'lib/libusb')
| -rw-r--r-- | lib/libusb/libusb10.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libusb/libusb10.c b/lib/libusb/libusb10.c index 9a5154e7e5f9..25520d2ab5ec 100644 --- a/lib/libusb/libusb10.c +++ b/lib/libusb/libusb10.c @@ -379,8 +379,6 @@ libusb_open_device_with_vid_pid(libusb_context *ctx, uint16_t vendor_id, if ((i = libusb_get_device_list(ctx, &devs)) < 0) return (NULL); - pdev = NULL; - for (j = 0; j < i; j++) { pdev = devs[j]->os_priv; pdesc = libusb20_dev_get_device_desc(pdev); @@ -396,6 +394,8 @@ libusb_open_device_with_vid_pid(libusb_context *ctx, uint16_t vendor_id, break; } } + if (j == i) + pdev = NULL; libusb_free_device_list(devs, 1); DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_open_device_width_vid_pid leave"); |
