]> git.ipfire.org Git - thirdparty/linux.git/blobdiff - drivers/usb/core/port.c
Merge tag 'usb-6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
[thirdparty/linux.git] / drivers / usb / core / port.c
index e1613b02c19fde930df2121f254c2f60f533d406..5b5e613a11e599bdb05dd121ad073f69a7f5b386 100644 (file)
@@ -574,7 +574,7 @@ static int match_location(struct usb_device *peer_hdev, void *p)
        struct usb_hub *peer_hub = usb_hub_to_struct_hub(peer_hdev);
        struct usb_device *hdev = to_usb_device(port_dev->dev.parent->parent);
 
-       if (!peer_hub)
+       if (!peer_hub || port_dev->connect_type == USB_PORT_NOT_USED)
                return 0;
 
        hcd = bus_to_hcd(hdev->bus);
@@ -585,7 +585,8 @@ static int match_location(struct usb_device *peer_hdev, void *p)
 
        for (port1 = 1; port1 <= peer_hdev->maxchild; port1++) {
                peer = peer_hub->ports[port1 - 1];
-               if (peer && peer->location == port_dev->location) {
+               if (peer && peer->connect_type != USB_PORT_NOT_USED &&
+                   peer->location == port_dev->location) {
                        link_peers_report(port_dev, peer);
                        return 1; /* done */
                }