diff options
author | Hans Petter Selasky <hselasky@FreeBSD.org> | 2021-06-11 15:06:10 +0000 |
---|---|---|
committer | Hans Petter Selasky <hselasky@FreeBSD.org> | 2021-06-11 15:06:44 +0000 |
commit | 6847ea50196f1a685be408a24f01cb8d407da19c (patch) | |
tree | e65befb53fe5ecc70cbfc830d33c64335203c25c /lib/libusb/libusb20.c | |
parent | fa3746be4203fc9a3414afb21d964eec8bad74f8 (diff) | |
download | src-6847ea50196f1a685be408a24f01cb8d407da19c.tar.gz src-6847ea50196f1a685be408a24f01cb8d407da19c.zip |
Improve handling of USB device re-open in the LibUSB v1.x API.
Make sure the "device_is_gone" flag is cleared after every successful open,
so that the "device_is_gone" flag doesn't persist forever.
Found by: sergii.dmytruk@3mdeb.com
PR: 256296
MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking
Diffstat (limited to 'lib/libusb/libusb20.c')
-rw-r--r-- | lib/libusb/libusb20.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/libusb/libusb20.c b/lib/libusb/libusb20.c index 6c2bf721bea9..4323552b83ad 100644 --- a/lib/libusb/libusb20.c +++ b/lib/libusb/libusb20.c @@ -608,6 +608,11 @@ libusb20_dev_close(struct libusb20_device *pdev) pdev->is_opened = 0; + /* + * Make sure libusb20_tr_get_pointer() fails: + */ + pdev->nTransfer = 0; + /* * The following variable is only used by the libusb v0.1 * compat layer: |