]> Git Repo - qemu.git/commit - hw/usb/hcd-ehci.c
ehci: fix segfault when hot-unplugging ehci controller
authorGonglei <[email protected]>
Wed, 18 Mar 2015 09:33:47 +0000 (17:33 +0800)
committerGerd Hoffmann <[email protected]>
Fri, 20 Mar 2015 07:50:12 +0000 (08:50 +0100)
commit4e289b1b62c8e271e3400317b4c3d98909093bc4
treef24d7ddb4f9500b23f823015eade04f4414a68e6
parent88dd1b8d0063ff16c54dc19c8b52508a00108f50
ehci: fix segfault when hot-unplugging ehci controller

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.

Cc: qemu-stable <[email protected]>
Reported-by: Lidonglin <[email protected]>
Signed-off-by: Gonglei <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
hw/usb/hcd-ehci-pci.c
hw/usb/hcd-ehci-sysbus.c
hw/usb/hcd-ehci.c
hw/usb/hcd-ehci.h
This page took 0.026044 seconds and 4 git commands to generate.