mirror of
https://github.com/freebsd/freebsd-src
synced 2024-07-22 10:48:02 +00:00
bhnd_chipc(4): Break cyclic references to the ChipCommon device
bhnd_chipc's children may hold strong provider references to their parent; we must detach any children before attempting to deregister the bhnd_chipc device as a bus service provider. Approved by: adrian (mentor, implicit) Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
1fe84e6f44
commit
19b3e4aa48
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=326450
|
@ -245,10 +245,10 @@ chipc_detach(device_t dev)
|
|||
|
||||
sc = device_get_softc(dev);
|
||||
|
||||
if ((error = bhnd_deregister_provider(dev, BHND_SERVICE_ANY)))
|
||||
if ((error = bus_generic_detach(dev)))
|
||||
return (error);
|
||||
|
||||
if ((error = bus_generic_detach(dev)))
|
||||
if ((error = bhnd_deregister_provider(dev, BHND_SERVICE_ANY)))
|
||||
return (error);
|
||||
|
||||
chipc_release_region(sc, sc->core_region, RF_ALLOCATED|RF_ACTIVE);
|
||||
|
|
Loading…
Reference in a new issue