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

Fix rl(4)'s lock behavior upon deinitialization. I would get a panic

when kldunloading due to its private locking being acquired recursively.
This commit is contained in:
Brian Feldman 2004-08-09 20:22:17 +00:00
parent 332e72ddb7
commit 6eb3cb4a13
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=133403

View File

@ -1001,21 +1001,22 @@ rl_detach(device_t dev)
{
struct rl_softc *sc;
struct ifnet *ifp;
int attached;
sc = device_get_softc(dev);
ifp = &sc->arpcom.ac_if;
KASSERT(mtx_initialized(&sc->rl_mtx), ("rl mutex not initialized"));
attached = device_is_attached(dev);
/* These should only be active if attach succeeded */
if (attached)
ether_ifdetach(ifp);
RL_LOCK(sc);
#if 0
sc->suspended = 1;
#endif
/* These should only be active if attach succeeded */
if (device_is_attached(dev)) {
if (attached)
rl_stop(sc);
ether_ifdetach(ifp);
}
if (sc->rl_miibus)
device_delete_child(dev, sc->rl_miibus);
bus_generic_detach(dev);