From 5b39fd0ed367b18144912e8b78be3d395ba33d25 Mon Sep 17 00:00:00 2001 From: Xiaoguang Wu Date: Mon, 12 Nov 2018 16:58:00 +0800 Subject: [PATCH] DM USB: xHCI: fix error logic of allocating xHCI slot The 'slot_allocated[]' field of pci_xhci_vdev is used as flag of slot allocation. In current design, this variable is not set to false in disconnection callback 'pci_xhci_native_usb_dev_disconn_cb'. This patch is used to fix it. Tracked-On: #1894 Signed-off-by: Xiaoguang Wu Reviewed-by: Liang Yang Acked-by: Yu Wang --- devicemodel/hw/pci/xhci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/devicemodel/hw/pci/xhci.c b/devicemodel/hw/pci/xhci.c index 5d3f04548..d82d52ac7 100644 --- a/devicemodel/hw/pci/xhci.c +++ b/devicemodel/hw/pci/xhci.c @@ -836,6 +836,7 @@ pci_xhci_native_usb_dev_disconn_cb(void *hci_data, void *dev_data) edev->dev_slotstate = XHCI_ST_DISABLED; xdev->devices[vport] = NULL; xdev->slots[slot] = NULL; + xdev->slot_allocated[slot] = false; pci_xhci_dev_destroy(edev); need_intr = 0; return 0;