Protect against NULL in ath_beacon_config()
authorproski <proski@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Sun, 16 Dec 2007 16:40:42 +0000 (16:40 +0000)
committerproski <proski@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Sun, 16 Dec 2007 16:40:42 +0000 (16:40 +0000)
It's called with NULL vap in several places, and the old
ath_beacon_config() had such protection.  Without this check, the kernel
panics after association in managed mode.

git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3064 0192ed92-7a03-0410-a25b-9323aeb14dbd

ath/if_ath.c

index 46b8e36d474f6b5ad38b63e888a1bbf474ef77ce..37b9a55716fc59353d72cfac0df9459003a9baba 100644 (file)
@@ -4787,7 +4787,7 @@ ath_beacon_config(struct ath_softc *sc, struct ieee80211vap *vap)
        struct sk_buff *skb;
 
        avp = ATH_VAP(vap);
-       if (avp->av_bcbuf == NULL) {
+       if (avp == NULL || avp->av_bcbuf == NULL) {
                DPRINTF(sc, ATH_DEBUG_ANY, "%s: avp=%p av_bcbuf=%p\n",
                         __func__, avp, avp != NULL ? avp->av_bcbuf : NULL);
                return;