aboutsummaryrefslogtreecommitdiff
path: root/hw/usb/hcd-ehci.h
diff options
context:
space:
mode:
authorLi Qiang <liqiang6-s@360.cn>2017-02-07 18:42:55 -0800
committerGerd Hoffmann <kraxel@redhat.com>2017-02-21 08:11:42 +0100
commitd710e1e7bd3d5bfc26b631f02ae87901ebe646b0 (patch)
treedeb72b487c59b45b7b0aab2bb074fe291ddd12bb /hw/usb/hcd-ehci.h
parent56f9e46b841c7be478ca038d8d4085d776ab4b0d (diff)
usb: ehci: fix memory leak in ehci
In usb_ehci_init function, it initializes 's->ipacket', but there is no corresponding function to free this. As the ehci can be hotplug and unplug, this will leak host memory leak. In order to make the hierarchy clean, we should add a ehci pci finalize function, then call the clean function in ehci device. Signed-off-by: Li Qiang <liqiang6-s@360.cn> Message-id: 589a85b8.3c2b9d0a.b8e6.1434@mx.google.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb/hcd-ehci.h')
-rw-r--r--hw/usb/hcd-ehci.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/usb/hcd-ehci.h b/hw/usb/hcd-ehci.h
index 3fd7038658..938d8aa284 100644
--- a/hw/usb/hcd-ehci.h
+++ b/hw/usb/hcd-ehci.h
@@ -323,6 +323,7 @@ struct EHCIState {
extern const VMStateDescription vmstate_ehci;
void usb_ehci_init(EHCIState *s, DeviceState *dev);
+void usb_ehci_finalize(EHCIState *s);
void usb_ehci_realize(EHCIState *s, DeviceState *dev, Error **errp);
void usb_ehci_unrealize(EHCIState *s, DeviceState *dev, Error **errp);
void ehci_reset(void *opaque);