5544c1b
From 35fe185a5455160db638820211bad5aed45a669f Mon Sep 17 00:00:00 2001
c8dfc65
From: Hans de Goede <hdegoede@redhat.com>
c8dfc65
Date: Thu, 30 Aug 2012 15:00:33 +0200
5544c1b
Subject: [PATCH] ehci: Properly cleanup packets on cancel
c8dfc65
c8dfc65
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
5544c1b
(cherry picked from commit 0e7953525f52aa6c098dc0c1ce0b4a80ce82da45)
5544c1b
5544c1b
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
c8dfc65
---
c8dfc65
 hw/usb/hcd-ehci.c | 2 ++
c8dfc65
 1 file changed, 2 insertions(+)
c8dfc65
c8dfc65
diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
c8dfc65
index 78a248f..4fe85c8 100644
c8dfc65
--- a/hw/usb/hcd-ehci.c
c8dfc65
+++ b/hw/usb/hcd-ehci.c
c8dfc65
@@ -747,6 +747,8 @@ static void ehci_free_packet(EHCIPacket *p)
c8dfc65
     trace_usb_ehci_packet_action(p->queue, p, "free");
c8dfc65
     if (p->async == EHCI_ASYNC_INFLIGHT) {
c8dfc65
         usb_cancel_packet(&p->packet);
c8dfc65
+        usb_packet_unmap(&p->packet, &p->sgl);
c8dfc65
+        qemu_sglist_destroy(&p->sgl);
c8dfc65
     }
c8dfc65
     QTAILQ_REMOVE(&p->queue->packets, p, next);
c8dfc65
     usb_packet_cleanup(&p->packet);
c8dfc65
-- 
5544c1b
1.7.12.1
c8dfc65