mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Fix a panic that it's occurred when NDIS init handler returned a error
by unknown reasons. In this case, sc->ifp is still NULL so it will cause a page fault during calling ndis_detach()
This commit is contained in:
parent
32e9c9dc71
commit
e54b92f37b
1 changed files with 8 additions and 5 deletions
|
|
@ -996,15 +996,18 @@ ndis_detach(dev)
|
|||
sc = device_get_softc(dev);
|
||||
NDIS_LOCK(sc);
|
||||
ifp = sc->ifp;
|
||||
ifp->if_flags &= ~IFF_UP;
|
||||
if (ifp != NULL)
|
||||
ifp->if_flags &= ~IFF_UP;
|
||||
|
||||
if (device_is_attached(dev)) {
|
||||
NDIS_UNLOCK(sc);
|
||||
ndis_stop(sc);
|
||||
if (sc->ndis_80211)
|
||||
ieee80211_ifdetach(ifp->if_l2com);
|
||||
else
|
||||
ether_ifdetach(ifp);
|
||||
if (ifp != NULL) {
|
||||
if (sc->ndis_80211)
|
||||
ieee80211_ifdetach(ifp->if_l2com);
|
||||
else
|
||||
ether_ifdetach(ifp);
|
||||
}
|
||||
} else
|
||||
NDIS_UNLOCK(sc);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue