usb-ohci: Fix memory leak for ohci timer
authorGonglei <arei.gonglei@huawei.com>
Wed, 4 Jun 2014 08:31:47 +0000 (16:31 +0800)
committerGerd Hoffmann <kraxel@redhat.com>
Fri, 29 Aug 2014 10:51:44 +0000 (12:51 +0200)
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/usb/hcd-ohci.c

index cacf7b0..5505f0a 100644 (file)
@@ -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;
 }