From 3a768bc80f041aeaa67063101593032e8ad9245e Mon Sep 17 00:00:00 2001 From: hselasky Date: Mon, 8 Jun 2020 09:25:01 +0000 Subject: [PATCH] MFC r361577: Don't allow USB device drivers to parent own interface. It will prevent proper USB device detach. Sponsored by: Mellanox Technologies git-svn-id: svn://svn.freebsd.org/base/stable/10@361908 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/dev/usb/usb_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/usb/usb_device.c b/sys/dev/usb/usb_device.c index cc5bf36e4..c4af1b8cb 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; } -- 2.42.0