From 5e0552018c2e8a0ef04417ee99095ebe43506e4b Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Thu, 28 May 2020 08:05:46 +0000 Subject: [PATCH] Don't allow USB device drivers to parent own interface. It will prevent proper USB device detach. MFC after: 3 days Sponsored by: Mellanox Technologies --- 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 275914ed033..e4ed447b813 100644 --- a/sys/dev/usb/usb_device.c +++ b/sys/dev/usb/usb_device.c @@ -1402,7 +1402,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; }