958e1b
From 524882651970113d0b375a99362bd5b9e9b7f7a7 Mon Sep 17 00:00:00 2001
958e1b
From: Gerd Hoffmann <kraxel@redhat.com>
958e1b
Date: Fri, 11 Jul 2014 14:21:01 +0200
958e1b
Subject: [PATCH 27/43] xhci: child detach fix
958e1b
958e1b
Message-id: <1405088470-24115-29-git-send-email-kraxel@redhat.com>
958e1b
Patchwork-id: 59841
958e1b
O-Subject: [RHEL-7.1 qemu-kvm PATCH 28/37] xhci: child detach fix
958e1b
Bugzilla: 980833
958e1b
RH-Acked-by: Dr. David Alan Gilbert (git) <dgilbert@redhat.com>
958e1b
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
958e1b
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
958e1b
958e1b
xhci_child_detach() zaps the wrong slot when unplugging a device
958e1b
connected via usb-hub:  Instead of the device's slot the slot of the
958e1b
usb-hub is used.  Fix it.
958e1b
958e1b
https://bugzilla.redhat.com/show_bug.cgi?id=1075846
958e1b
958e1b
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
958e1b
Reviewed-by: Gonglei <arei.gonglei@huawei.com>
958e1b
(cherry picked from commit 463c534db516701ac732ac606c33c7101cf22e56)
958e1b
---
958e1b
 hw/usb/hcd-xhci.c | 2 +-
958e1b
 1 file changed, 1 insertion(+), 1 deletion(-)
958e1b
958e1b
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
958e1b
---
958e1b
 hw/usb/hcd-xhci.c | 2 +-
958e1b
 1 file changed, 1 insertion(+), 1 deletion(-)
958e1b
958e1b
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
958e1b
index 2352b12..dc10ab0 100644
958e1b
--- a/hw/usb/hcd-xhci.c
958e1b
+++ b/hw/usb/hcd-xhci.c
958e1b
@@ -3438,7 +3438,7 @@ static void xhci_child_detach(USBPort *uport, USBDevice *child)
958e1b
     USBBus *bus = usb_bus_from_device(child);
958e1b
     XHCIState *xhci = container_of(bus, XHCIState, bus);
958e1b
 
958e1b
-    xhci_detach_slot(xhci, uport);
958e1b
+    xhci_detach_slot(xhci, child->port);
958e1b
 }
958e1b
 
958e1b
 static USBPortOps xhci_uport_ops = {
958e1b
-- 
958e1b
1.8.3.1
958e1b