freebsd-dev/sys/mips
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
..
adm5120 Remove NULL checks after M_WAITOK allocations from sys/mips/. 2016-05-11 09:42:24 +00:00
alchemy Remove NULL checks after M_WAITOK allocations from sys/mips/. 2016-05-11 09:42:24 +00:00
atheros Fix device delete child function. 2016-10-17 10:20:38 +00:00
beri Fix the resource_list_print_type() calls to use uintmax_t. 2016-03-22 22:25:08 +00:00
broadcom Split bcm_mipscore.c into bcm_bmips (BMIPS32/BMIPS3300) and bcm_mips74k 2016-09-18 21:28:09 +00:00
cavium Fix device delete child function. 2016-10-17 10:20:38 +00:00
conf Add COMPAT_FREEBSD10 to the MIPS ERL kernel config 2016-10-12 18:49:30 +00:00
gxemul Allow the use of soft-interrupts for sending IPIs. 2016-09-08 17:37:13 +00:00
idt Remove NULL checks after M_WAITOK allocations from sys/mips/. 2016-05-11 09:42:24 +00:00
include Fix building on i386 and arm. But 'public domain' headers on the files 2016-10-13 06:56:23 +00:00
malta Add SMP support for MTI Malta 34kf CPU. 2016-09-12 16:38:51 +00:00
mediatek Fix device delete child function. 2016-10-17 10:20:38 +00:00
mips INTRNG: Propagate IRQ activation error to API consumer 2016-10-12 17:10:59 +00:00
nlm Allow the use of soft-interrupts for sending IPIs. 2016-09-08 17:37:13 +00:00
rmi Fix device delete child function. 2016-10-17 10:20:38 +00:00
rt305x Fix device delete child function. 2016-10-17 10:20:38 +00:00
sibyte Allow the use of soft-interrupts for sending IPIs. 2016-09-08 17:37:13 +00:00