bhnd_chipc(4): Fix leak of child device ivars by explicitly deleting

any children prior to detach.

With the newbus child deletion ordering changes introduced in r307518,
parent devices are now detached (and their driver set to NULL) prior to
detaching and deleting child devices; child-related bus methods (e.g.
BUS_CHILD_DETACHED, BUS_CHILD_DELETED) are no longer be dispatched to the
parent device driver after it returns 0 (success) from DEVICE_DETACH.

Sponsored by:   The FreeBSD Foundation
This commit is contained in:
Landon J. Fuller 2018-01-20 01:55:34 +00:00
parent a225321fbc
commit f248a99a0e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=328187

View File

@ -250,6 +250,9 @@ chipc_detach(device_t dev)
if ((error = bus_generic_detach(dev)))
return (error);
if ((error = device_delete_children(dev)))
return (error);
if ((error = bhnd_deregister_provider(dev, BHND_SERVICE_ANY)))
return (error);