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
42821ae3c2
commit
ea294a1122
@ -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…
x
Reference in New Issue
Block a user