diff options
author | scottl <scottl@FreeBSD.org> | 2005-03-31 17:16:40 +0000 |
---|---|---|
committer | scottl <scottl@FreeBSD.org> | 2005-03-31 17:16:40 +0000 |
commit | ea294a1122158d12d35eed1e8fc98208c8ad7945 (patch) | |
tree | 4ac66294954b8d9ed7f81b3058e7c5032d0c4c32 /sys/pci | |
parent | 42821ae3c25cf2a9a3d6c7ed847f921e2e9918ed (diff) | |
download | FreeBSD-src-ea294a1122158d12d35eed1e8fc98208c8ad7945.zip FreeBSD-src-ea294a1122158d12d35eed1e8fc98208c8ad7945.tar.gz |
If resource allocation fails, we could wind up freeing the cdev without it
being allocated. Add a simple check for this.
Submitted by: yongari
Diffstat (limited to 'sys/pci')
-rw-r--r-- | sys/pci/if_ti.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/pci/if_ti.c b/sys/pci/if_ti.c index 56e2207..86cea7c 100644 --- a/sys/pci/if_ti.c +++ b/sys/pci/if_ti.c @@ -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; |