aboutsummaryrefslogtreecommitdiff
path: root/hw/usb/hcd-ohci.c
diff options
context:
space:
mode:
authorGonglei <arei.gonglei@huawei.com>2014-06-04 16:31:47 +0800
committerGerd Hoffmann <kraxel@redhat.com>2014-08-29 12:51:44 +0200
commit80be63df5a19816629343f704345b71e83e6d960 (patch)
tree83cf0dbab5e856c5ddf727717570d4f31493143f /hw/usb/hcd-ohci.c
parente5a9bece9b5064d0cb0fda68ff68b9361085f400 (diff)
downloadqemu-80be63df5a19816629343f704345b71e83e6d960.zip
qemu-80be63df5a19816629343f704345b71e83e6d960.tar.gz
qemu-80be63df5a19816629343f704345b71e83e6d960.tar.bz2
usb-ohci: Fix memory leak for ohci timer
Signed-off-by: Gonglei <arei.gonglei@huawei.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb/hcd-ohci.c')
-rw-r--r--hw/usb/hcd-ohci.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c
index cacf7b0..5505f0a 100644
--- a/hw/usb/hcd-ohci.c
+++ b/hw/usb/hcd-ohci.c
@@ -1371,8 +1371,10 @@ static int ohci_bus_start(OHCIState *ohci)
/* Stop sending SOF tokens on the bus */
static void ohci_bus_stop(OHCIState *ohci)
{
- if (ohci->eof_timer)
+ if (ohci->eof_timer) {
timer_del(ohci->eof_timer);
+ timer_free(ohci->eof_timer);
+ }
ohci->eof_timer = NULL;
}