From ecf0585bf2d0ea1bf8d9e03a917f41ca718c4a66 Mon Sep 17 00:00:00 2001 From: Xiaoguang Wu Date: Thu, 18 Oct 2018 17:45:26 +0800 Subject: [PATCH] DM USB: xHCI: fix incorrect device searching logic The function pci_xhci_get_native_port_index_by_path didn't compare the bus number during the process of native USB device searching. This patch is used to fix it. Tracked-On: #1434 Signed-off-by: Xiaoguang Wu Reviewed-by: Liang Yang Acked-by: Yu Wang --- devicemodel/hw/pci/xhci.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/devicemodel/hw/pci/xhci.c b/devicemodel/hw/pci/xhci.c index d088150e0..d6405b213 100755 --- a/devicemodel/hw/pci/xhci.c +++ b/devicemodel/hw/pci/xhci.c @@ -548,6 +548,9 @@ pci_xhci_get_native_port_index_by_path(struct pci_xhci_vdev *xdev, for (i = 0; i < XHCI_MAX_VIRT_PORTS; i++) { p = &xdev->native_ports[i].info.path; + if (p->bus != path->bus) + continue; + if (p->depth != path->depth) continue;