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:
parent
a225321fbc
commit
f248a99a0e
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user