File: composite-hid-close.patch

package info (click to toggle)
qtwebengine-opensource-src 5.7.1+dfsg-6.1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,028,096 kB
  • ctags: 1,436,736
  • sloc: cpp: 5,960,176; ansic: 3,477,727; asm: 395,492; python: 320,633; sh: 96,504; perl: 69,449; xml: 42,977; makefile: 28,408; objc: 9,962; yacc: 9,847; tcl: 5,430; lex: 2,259; ruby: 1,053; lisp: 522; awk: 497; pascal: 310; cs: 249; sed: 53
file content (32 lines) | stat: -rw-r--r-- 1,194 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
diff --git a/libusb/os/windows_usb.c b/libusb/os/windows_usb.c
index 9ae11b1..259897e 100644
--- a/libusb/os/windows_usb.c
+++ b/libusb/os/windows_usb.c
@@ -4236,6 +4236,7 @@ static void composite_close(int sub_api, struct libusb_device_handle *dev_handle
 	struct windows_device_priv *priv = _device_priv(dev_handle->dev);
 	uint8_t i;
 	bool available[SUB_API_MAX];
+	bool has_hid = false;
 
 	for (i = 0; i<SUB_API_MAX; i++) {
 		available[i] = false;
@@ -4245,6 +4246,8 @@ static void composite_close(int sub_api, struct libusb_device_handle *dev_handle
 		if ( (priv->usb_interface[i].apib->id == USB_API_WINUSBX)
 		  && (priv->usb_interface[i].sub_api != SUB_API_NOTSET) ) {
 			available[priv->usb_interface[i].sub_api] = true;
+		} else if (priv->usb_interface[i].apib->id == USB_API_HID) {
+			has_hid = true;
 		}
 	}
 
@@ -4253,6 +4256,10 @@ static void composite_close(int sub_api, struct libusb_device_handle *dev_handle
 			usb_api_backend[USB_API_WINUSBX].close(i, dev_handle);
 		}
 	}
+
+	if (has_hid) {
+		usb_api_backend[USB_API_HID].close(sub_api, dev_handle);
+	}
 }
 
 static int composite_claim_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface)