Destroy the /dev device before destroying the mutex or releasing resources
rather than afterwards. MFC after: 1 week
This commit is contained in:
parent
619a2b9cae
commit
91b174b0da
@ -253,9 +253,10 @@ int
|
|||||||
agp_generic_detach(device_t dev)
|
agp_generic_detach(device_t dev)
|
||||||
{
|
{
|
||||||
struct agp_softc *sc = device_get_softc(dev);
|
struct agp_softc *sc = device_get_softc(dev);
|
||||||
|
|
||||||
|
destroy_dev(sc->as_devnode);
|
||||||
bus_release_resource(dev, SYS_RES_MEMORY, AGP_APBASE, sc->as_aperture);
|
bus_release_resource(dev, SYS_RES_MEMORY, AGP_APBASE, sc->as_aperture);
|
||||||
mtx_destroy(&sc->as_lock);
|
mtx_destroy(&sc->as_lock);
|
||||||
destroy_dev(sc->as_devnode);
|
|
||||||
agp_flush_cache();
|
agp_flush_cache();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -253,9 +253,10 @@ int
|
|||||||
agp_generic_detach(device_t dev)
|
agp_generic_detach(device_t dev)
|
||||||
{
|
{
|
||||||
struct agp_softc *sc = device_get_softc(dev);
|
struct agp_softc *sc = device_get_softc(dev);
|
||||||
|
|
||||||
|
destroy_dev(sc->as_devnode);
|
||||||
bus_release_resource(dev, SYS_RES_MEMORY, AGP_APBASE, sc->as_aperture);
|
bus_release_resource(dev, SYS_RES_MEMORY, AGP_APBASE, sc->as_aperture);
|
||||||
mtx_destroy(&sc->as_lock);
|
mtx_destroy(&sc->as_lock);
|
||||||
destroy_dev(sc->as_devnode);
|
|
||||||
agp_flush_cache();
|
agp_flush_cache();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user