1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-14 10:09:48 +00:00

Destroy the /dev device before destroying the mutex or releasing resources

rather than afterwards.

MFC after:	1 week
This commit is contained in:
John Baldwin 2005-12-20 20:03:16 +00:00
parent 04d6a912e4
commit 4c2546c1a9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=153562
2 changed files with 4 additions and 2 deletions

View File

@ -253,9 +253,10 @@ int
agp_generic_detach(device_t 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);
mtx_destroy(&sc->as_lock);
destroy_dev(sc->as_devnode);
agp_flush_cache();
return 0;
}

View File

@ -253,9 +253,10 @@ int
agp_generic_detach(device_t 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);
mtx_destroy(&sc->as_lock);
destroy_dev(sc->as_devnode);
agp_flush_cache();
return 0;
}