From 6847ea50196f1a685be408a24f01cb8d407da19c Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Fri, 11 Jun 2021 17:06:10 +0200 Subject: 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 --- lib/libusb/libusb20.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/libusb/libusb20.c') 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: -- cgit v1.2.3