If resource allocation fails, we could wind up freeing the cdev without it
being allocated. Add a simple check for this. Submitted by: yongari
This commit is contained in:
parent
fe234894e5
commit
69bbb4fe70
@ -2311,7 +2311,8 @@ ti_detach(dev)
|
||||
struct ifnet *ifp;
|
||||
|
||||
sc = device_get_softc(dev);
|
||||
destroy_dev(sc->dev);
|
||||
if (sc->dev)
|
||||
destroy_dev(sc->dev);
|
||||
KASSERT(mtx_initialized(&sc->ti_mtx), ("ti mutex not initialized"));
|
||||
TI_LOCK(sc);
|
||||
ifp = &sc->arpcom.ac_if;
|
||||
|
@ -2311,7 +2311,8 @@ ti_detach(dev)
|
||||
struct ifnet *ifp;
|
||||
|
||||
sc = device_get_softc(dev);
|
||||
destroy_dev(sc->dev);
|
||||
if (sc->dev)
|
||||
destroy_dev(sc->dev);
|
||||
KASSERT(mtx_initialized(&sc->ti_mtx), ("ti mutex not initialized"));
|
||||
TI_LOCK(sc);
|
||||
ifp = &sc->arpcom.ac_if;
|
||||
|
Loading…
Reference in New Issue
Block a user