ehci: Properly cleanup packets on cancel
authorHans de Goede <hdegoede@redhat.com>
Thu, 30 Aug 2012 13:00:33 +0000 (15:00 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 11 Sep 2012 05:42:59 +0000 (07:42 +0200)
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
hw/usb/hcd-ehci.c

index 78a248f..4fe85c8 100644 (file)
@@ -747,6 +747,8 @@ static void ehci_free_packet(EHCIPacket *p)
     trace_usb_ehci_packet_action(p->queue, p, "free");
     if (p->async == EHCI_ASYNC_INFLIGHT) {
         usb_cancel_packet(&p->packet);
+        usb_packet_unmap(&p->packet, &p->sgl);
+        qemu_sglist_destroy(&p->sgl);
     }
     QTAILQ_REMOVE(&p->queue->packets, p, next);
     usb_packet_cleanup(&p->packet);