1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-22 11:17:19 +00:00

In device detach don't access ifnet structure unless device is

attached. This fixes NULL pointer dereference when polling(9) is
active and unsupported hardware is detected in device attach.
This commit is contained in:
Pyun YongHyeon 2008-07-02 06:41:46 +00:00
parent 3021aef8c9
commit 81cf2eb6db
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=180173

View File

@ -1391,12 +1391,12 @@ re_detach(dev)
ifp = sc->rl_ifp;
KASSERT(mtx_initialized(&sc->rl_mtx), ("re mutex not initialized"));
#ifdef DEVICE_POLLING
if (ifp->if_capenable & IFCAP_POLLING)
ether_poll_deregister(ifp);
#endif
/* These should only be active if attach succeeded */
if (device_is_attached(dev)) {
#ifdef DEVICE_POLLING
if (ifp->if_capenable & IFCAP_POLLING)
ether_poll_deregister(ifp);
#endif
RL_LOCK(sc);
#if 0
sc->suspended = 1;