aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2020-06-08 09:25:01 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2020-06-08 09:25:01 +0000
commit8e51c3499e0273806331f4172c5db90b061734e0 (patch)
treebd50d5125b668196cf7a7d9f912a69d0dec907ce
parentced76afa5b2b1b529b0e5271528237119f92a5b0 (diff)
downloadsrc-8e51c3499e0273806331f4172c5db90b061734e0.tar.gz
src-8e51c3499e0273806331f4172c5db90b061734e0.zip
MFC r361577:
Don't allow USB device drivers to parent own interface. It will prevent proper USB device detach. Sponsored by: Mellanox Technologies
Notes
Notes: svn path=/stable/10/; revision=361908
-rw-r--r--sys/dev/usb/usb_device.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/usb/usb_device.c b/sys/dev/usb/usb_device.c
index cc5bf36e419f..c4af1b8cbfef 100644
--- a/sys/dev/usb/usb_device.c
+++ b/sys/dev/usb/usb_device.c
@@ -1274,7 +1274,7 @@ usbd_set_parent_iface(struct usb_device *udev, uint8_t iface_index,
{
struct usb_interface *iface;
- if (udev == NULL) {
+ if (udev == NULL || iface_index == parent_index) {
/* nothing to do */
return;
}