diff options
author | adrian <adrian@FreeBSD.org> | 2012-02-25 08:01:29 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2012-02-25 08:01:29 +0000 |
commit | 1227707e5566e30c536ae473402e3c3445c746c1 (patch) | |
tree | 796487a305a06786e36a7290e8bfc3441523789b /sys | |
parent | e402cd1dbaeac51c3b92d04e76d78a06e5c128d4 (diff) | |
download | FreeBSD-src-1227707e5566e30c536ae473402e3c3445c746c1.zip FreeBSD-src-1227707e5566e30c536ae473402e3c3445c746c1.tar.gz |
If an interrupt is received with no vap attached, just fail LINK events.
This fixes a NULL pointer dereference which occurs if the vap list is
empty but someone brings up the wi0 interface.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/wi/if_wi.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/dev/wi/if_wi.c b/sys/dev/wi/if_wi.c index 8e70dd6..cae3b6f 100644 --- a/sys/dev/wi/if_wi.c +++ b/sys/dev/wi/if_wi.c @@ -1511,6 +1511,10 @@ wi_info_intr(struct wi_softc *sc) case WI_INFO_LINK_STAT: wi_read_bap(sc, fid, sizeof(ltbuf), &stat, sizeof(stat)); DPRINTF(("wi_info_intr: LINK_STAT 0x%x\n", le16toh(stat))); + + if (vap == NULL) + goto finish; + switch (le16toh(stat)) { case WI_INFO_LINK_STAT_CONNECTED: if (vap->iv_state == IEEE80211_S_RUN && @@ -1566,6 +1570,7 @@ wi_info_intr(struct wi_softc *sc) le16toh(ltbuf[1]), le16toh(ltbuf[0]))); break; } +finish: CSR_WRITE_2(sc, WI_EVENT_ACK, WI_EV_INFO); } |