[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 5/7] xhci: Fix memory leak on xhci_disable_ep
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 5/7] xhci: Fix memory leak on xhci_disable_ep |
Date: |
Thu, 19 Sep 2013 11:34:56 +0200 |
From: Hans de Goede <address@hidden>
The USBPacket-s in the transfers need to be cleaned up so that the memory
allocated by the iovec in there gets freed.
Signed-off-by: Hans de Goede <address@hidden>
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/usb/hcd-xhci.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index eddfd50..469c24d 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -1380,6 +1380,7 @@ static TRBCCode xhci_disable_ep(XHCIState *xhci, unsigned
int slotid,
{
XHCISlot *slot;
XHCIEPContext *epctx;
+ int i;
trace_usb_xhci_ep_disable(slotid, epid);
assert(slotid >= 1 && slotid <= xhci->numslots);
@@ -1400,6 +1401,10 @@ static TRBCCode xhci_disable_ep(XHCIState *xhci,
unsigned int slotid,
xhci_free_streams(epctx);
}
+ for (i = 0; i < ARRAY_SIZE(epctx->transfers); i++) {
+ usb_packet_cleanup(&epctx->transfers[i].packet);
+ }
+
xhci_set_ep_state(xhci, epctx, NULL, EP_DISABLED);
timer_free(epctx->kick_timer);
--
1.8.3.1
- [Qemu-devel] [PULL 0/7] usb patch queue, Gerd Hoffmann, 2013/09/19
- [Qemu-devel] [PATCH 6/7] usb: Also reset max_packet_size on ep_reset, Gerd Hoffmann, 2013/09/19
- [Qemu-devel] [PATCH 2/7] xhci: Fix number of streams allocated when using streams, Gerd Hoffmann, 2013/09/19
- [Qemu-devel] [PATCH 3/7] xhci: Init a transfers xhci, slotid and epid member on epctx alloc, Gerd Hoffmann, 2013/09/19
- [Qemu-devel] [PATCH 5/7] xhci: Fix memory leak on xhci_disable_ep,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH 4/7] xhci: Add xhci_epid_to_usbep helper function, Gerd Hoffmann, 2013/09/19
- [Qemu-devel] [PATCH 7/7] usb: Fix iovec memleak on combined-packet free, Gerd Hoffmann, 2013/09/19
- [Qemu-devel] [PATCH 1/7] usb: remove old usb-host code, Gerd Hoffmann, 2013/09/19