diff options
author | Gonglei | 2015-03-18 10:33:48 +0100 |
---|---|---|
committer | Gerd Hoffmann | 2015-03-20 08:50:06 +0100 |
commit | 88dd1b8d0063ff16c54dc19c8b52508a00108f50 (patch) | |
tree | b6a07f49e1c2623dc7c548dc1c759de73d948899 /hw/usb/hcd-ehci.c | |
parent | uhci: fix segfault when hot-unplugging uhci controller (diff) | |
download | qemu-88dd1b8d0063ff16c54dc19c8b52508a00108f50.tar.gz qemu-88dd1b8d0063ff16c54dc19c8b52508a00108f50.tar.xz qemu-88dd1b8d0063ff16c54dc19c8b52508a00108f50.zip |
ohci: fix resource cleanup leak
When hot-unplugging the usb controllers (ehci/uhci),
we have to clean all resouce of these devices,
involved registered reset handler. Otherwise, it
may cause NULL pointer access and/or segmentation fault
if we reboot the guest os after hot-unplugging.
Let's hook up reset via DeviceClass->reset() and drop
the qemu_register_reset() call. Then Qemu will register
and unregister the reset handler automatically.
Ohci does't support hotplugging/hotunplugging yet, but
existing resource cleanup leak logic likes ehci/uhci.
Cc: qemu-stable <qemu-stable@nongnu.org>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb/hcd-ehci.c')
0 files changed, 0 insertions, 0 deletions