qemu-patch-raspberry4/hw/usb
Gonglei 4e289b1b62 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 <qemu-stable@nongnu.org>
Reported-by: Lidonglin <lidonglin@huawei.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-03-20 08:50:12 +01:00
..
bus.c usb: Improve companion configuration error messages 2015-03-17 14:11:43 +01:00
ccid-card-emulated.c ccid-card-emulated: use EventNotifier 2014-07-01 15:49:51 +02:00
ccid-card-passthru.c devices: Associate devices to their logical category 2013-07-29 10:37:09 -05:00
ccid.h hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
combined-packet.c usb: Fix iovec memleak on combined-packet free 2013-09-19 11:28:40 +02:00
core.c usb: add usb_pick_speed 2014-06-02 16:29:00 +02:00
desc-msos.c usb: Pair g_malloc() with g_free(), not free() 2015-02-10 09:27:20 +03:00
desc.c usb: add usb_pick_speed 2014-06-02 16:29:00 +02:00
desc.h usb: add CompatibleID support to msos 2014-04-22 12:40:57 +02:00
dev-audio.c usb-audio: convert init to realize 2014-09-23 12:51:07 +02:00
dev-bluetooth.c usb: Improve -usbdevice error reporting a bit 2015-02-18 10:53:10 +01:00
dev-hid.c usb-hid: Add high speed keyboard configuration 2014-10-15 13:39:22 +02:00
dev-hub.c usb-hub: convert init to realize 2014-09-23 12:51:07 +02:00
dev-mtp.c usb-mtp: convert init to realize 2014-09-23 12:51:07 +02:00
dev-network.c QemuOpts: Drop qemu_opt_set(), rename qemu_opt_set_err(), fix use 2015-02-26 14:49:31 +01:00
dev-serial.c usb: Improve -usbdevice error reporting a bit 2015-02-18 10:53:10 +01:00
dev-smartcard-reader.c usb: Convert usb-ccid to hotplug handler API 2014-10-15 05:03:14 +02:00
dev-storage.c usb/dev-storage: Avoid qerror_report_err() outside QMP handlers 2015-03-17 14:23:53 +01:00
dev-uas.c dev-uas: using error_report instead of fprintf 2014-09-23 12:51:07 +02:00
dev-wacom.c dev-wacom: convert init to realize 2014-09-23 12:51:07 +02:00
hcd-ehci-pci.c ehci: fix segfault when hot-unplugging ehci controller 2015-03-20 08:50:12 +01:00
hcd-ehci-sysbus.c ehci: fix segfault when hot-unplugging ehci controller 2015-03-20 08:50:12 +01:00
hcd-ehci.c ehci: fix segfault when hot-unplugging ehci controller 2015-03-20 08:50:12 +01:00
hcd-ehci.h ehci: fix segfault when hot-unplugging ehci controller 2015-03-20 08:50:12 +01:00
hcd-musb.c hcd-musb: fix dereference null return value 2014-11-17 18:02:31 +01:00
hcd-ohci.c ohci: fix resource cleanup leak 2015-03-20 08:50:06 +01:00
hcd-uhci.c uhci: fix segfault when hot-unplugging uhci controller 2015-03-20 08:50:01 +01:00
hcd-xhci.c pci, pc, virtio fixes and cleanups 2015-03-09 09:14:28 +00:00
host-legacy.c usb: Improve -usbdevice error reporting a bit 2015-02-18 10:53:10 +01:00
host-libusb.c Clean up around error_get_pretty(), qerror_report_err() 2015-02-26 07:01:08 +00:00
host-stub.c hmp: Name HMP info handler functions hmp_info_SUBCOMMAND() 2015-02-18 11:58:50 +01:00
host.h usb-host: move legacy cmd line bits 2013-02-19 12:30:05 +01:00
libhw.c dma: eliminate DMAContext 2013-06-20 16:39:52 +02:00
Makefile.objs hw/usb: Include USB files only if necessary 2015-03-18 11:50:47 +01:00
quirks-ftdi-ids.h usbredir: Add support for buffered bulk input (v2) 2013-01-08 10:56:58 +01:00
quirks-pl2303-ids.h usbredir: Add support for buffered bulk input (v2) 2013-01-08 10:56:58 +01:00
quirks.c usbredir: Add support for buffered bulk input (v2) 2013-01-08 10:56:58 +01:00
quirks.h usbredir: Add support for buffered bulk input (v2) 2013-01-08 10:56:58 +01:00
redirect.c error: Use error_report_err() where appropriate 2015-02-18 10:51:09 +01:00