freebsd-dev/sys/dev/bhnd/cores
Hans Petter Selasky d3bf5efc1f Fix device delete child function.
When detaching device trees parent devices must be detached prior to
detaching its children. This is because parent devices can have
pointers to the child devices in their softcs which are not
invalidated by device_delete_child(). This can cause use after free
issues and panic().

Device drivers implementing trees, must ensure its detach function
detaches or deletes all its children before returning.

While at it remove now redundant device_detach() calls before
device_delete_child() and device_delete_children(), mostly in
the USB controller drivers.

Tested by:		Jan Henrik Sylvester <me@janh.de>
Reviewed by:		jhb
Differential Revision:	https://reviews.freebsd.org/D8070
MFC after:		2 weeks
2016-10-17 10:20:38 +00:00
..
chipc bhnd(4): Fix regression in BCM4331 SPROM pin reference counting. 2016-09-17 22:18:32 +00:00
pci bhnd(4): Add a vendor parameter to BHND_DEVICE(), replacing vendor-specific 2016-06-08 21:31:33 +00:00
pcie2 bhnd(4): Add a vendor parameter to BHND_DEVICE(), replacing vendor-specific 2016-06-08 21:31:33 +00:00
pmu bhnd(4): Implement common API for IOST/IOCTL register access and core reset 2016-09-24 04:08:16 +00:00
usb Fix device delete child function. 2016-10-17 10:20:38 +00:00