|
|
9ae3a8 |
From 1a353074ec2bc18c3f9dd0a56e5febb2cdc1892c Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: Gerd Hoffmann <kraxel@redhat.com>
|
|
|
9ae3a8 |
Date: Fri, 11 Jul 2014 14:20:45 +0200
|
|
|
9ae3a8 |
Subject: [PATCH 11/43] xhci: Fix memory leak on xhci_disable_ep
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Message-id: <1405088470-24115-13-git-send-email-kraxel@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 59821
|
|
|
9ae3a8 |
O-Subject: [RHEL-7.1 qemu-kvm PATCH 12/37] xhci: Fix memory leak on xhci_disable_ep
|
|
|
9ae3a8 |
Bugzilla: 980833
|
|
|
9ae3a8 |
RH-Acked-by: Dr. David Alan Gilbert (git) <dgilbert@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
From: Hans de Goede <hdegoede@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
The USBPacket-s in the transfers need to be cleaned up so that the memory
|
|
|
9ae3a8 |
allocated by the iovec in there gets freed.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
|
9ae3a8 |
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
|
9ae3a8 |
(cherry picked from commit b21da4e504fbdb907543a918b190783dc896d8e1)
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
hw/usb/hcd-xhci.c | 5 +++++
|
|
|
9ae3a8 |
1 file changed, 5 insertions(+)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
hw/usb/hcd-xhci.c | 5 +++++
|
|
|
9ae3a8 |
1 file changed, 5 insertions(+)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
|
|
|
9ae3a8 |
index 56145a5..bb3bba3 100644
|
|
|
9ae3a8 |
--- a/hw/usb/hcd-xhci.c
|
|
|
9ae3a8 |
+++ b/hw/usb/hcd-xhci.c
|
|
|
9ae3a8 |
@@ -1382,6 +1382,7 @@ static TRBCCode xhci_disable_ep(XHCIState *xhci, unsigned int slotid,
|
|
|
9ae3a8 |
{
|
|
|
9ae3a8 |
XHCISlot *slot;
|
|
|
9ae3a8 |
XHCIEPContext *epctx;
|
|
|
9ae3a8 |
+ int i;
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
trace_usb_xhci_ep_disable(slotid, epid);
|
|
|
9ae3a8 |
assert(slotid >= 1 && slotid <= xhci->numslots);
|
|
|
9ae3a8 |
@@ -1402,6 +1403,10 @@ static TRBCCode xhci_disable_ep(XHCIState *xhci, unsigned int slotid,
|
|
|
9ae3a8 |
xhci_free_streams(epctx);
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
+ for (i = 0; i < ARRAY_SIZE(epctx->transfers); i++) {
|
|
|
9ae3a8 |
+ usb_packet_cleanup(&epctx->transfers[i].packet);
|
|
|
9ae3a8 |
+ }
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
xhci_set_ep_state(xhci, epctx, NULL, EP_DISABLED);
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
qemu_free_timer(epctx->kick_timer);
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.8.3.1
|
|
|
9ae3a8 |
|