From 7b66be9d25fa85e2757f5b522ddde14258c9d204 Mon Sep 17 00:00:00 2001 From: hselasky Date: Mon, 8 Jun 2020 09:25:40 +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/9@361909 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 05f1e04c7..0dc9170b0 100644 --- a/sys/dev/usb/usb_device.c +++ b/sys/dev/usb/usb_device.c @@ -1241,7 +1241,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