Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12:Update
qemu
0262-ohci-allocate-timer-only-once.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0262-ohci-allocate-timer-only-once.patch of Package qemu
From 629c3c6c216d19939155b424459bb351b37b9557 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann <kraxel@redhat.com> Date: Mon, 22 Feb 2016 09:50:11 +0100 Subject: [PATCH] ohci: allocate timer only once. Allocate timer once, at init time, instead of allocating/freeing it all the time when starting/stopping the bus. Simplifies the code, also fixes bugs (memory leak) due to missing checks whenever the time is already allocated or not. Cc: Prasad J Pandit <pjp@fedoraproject.org> Reported-by: Zuozhi Fzz <zuozhi.fzz@alibaba-inc.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> (cherry picked from commit fa1298c2d623522eda7b4f1f721fcb935abb7360) [BR: CVE-2016-2391 BSC#967013] Signed-off-by: Bruce Rogers <brogers@suse.com> Conflicts: hw/usb/hcd-ohci.c --- hw/usb/hcd-ohci.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c index 93f186f5e7..69cb0cff22 100644 --- a/hw/usb/hcd-ohci.c +++ b/hw/usb/hcd-ohci.c @@ -1351,18 +1351,6 @@ static void ohci_frame_boundary(void *opaque) */ static int ohci_bus_start(OHCIState *ohci) { - ohci->eof_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, - ohci_frame_boundary, - ohci); - - if (ohci->eof_timer == NULL) { - fprintf(stderr, "usb-ohci: %s: timer_new_ns failed\n", ohci->name); - ohci_die(ohci); - return 0; - } - - DPRINTF("usb-ohci: %s: USB Operational\n", ohci->name); - ohci_sof(ohci); return 1; @@ -1371,9 +1359,7 @@ 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) - timer_del(ohci->eof_timer); - ohci->eof_timer = NULL; + timer_del(ohci->eof_timer); } /* Sets a flag in a port status register but only set it if the port is @@ -1900,6 +1886,8 @@ static int usb_ohci_init(OHCIState *ohci, DeviceState *dev, ohci->async_td = 0; qemu_register_reset(ohci_reset, ohci); + ohci->eof_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, + ohci_frame_boundary, ohci); return 0; }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor