ohci: allocate timer only once.
commitfa1298c2d623522eda7b4f1f721fcb935abb7360
authorGerd Hoffmann <kraxel@redhat.com>
Mon, 22 Feb 2016 08:50:11 +0000 (22 09:50 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 23 Feb 2016 10:13:18 +0000 (23 11:13 +0100)
tree5138e06933f9ee89d68dbfb879dd04a716c55fe4
parent5f77e06baa84323e5bbc96c2c7f4fe627078b210
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>
hw/usb/hcd-ohci.c