Fix dereferencing NULL in debug messages
authorproski <proski@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Wed, 3 Aug 2011 00:36:39 +0000 (00:36 +0000)
committerproski <proski@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Wed, 3 Aug 2011 00:36:39 +0000 (00:36 +0000)
Found by coccinelle.

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

ath/if_ath.c
net80211/ieee80211_node.c

index ed8d3e976803f21a039b8bbe253b30cde054e850..8d0716d8594a4e121811ad5f66625f405a0c04ae 100644 (file)
@@ -5201,10 +5201,12 @@ ath_beacon_generate(struct ath_softc *sc, struct ieee80211vap *vap, int *needmar
        }
 #endif
        avp = ATH_VAP(vap);
-       if (avp == NULL || avp->av_bcbuf == NULL) {
-               DPRINTF(sc, ATH_DEBUG_ANY, "Returning NULL, one of these "
-                               "is NULL {avp=%p av_bcbuf=%p}\n", 
-                               avp, avp->av_bcbuf);
+       if (avp == NULL) {
+               DPRINTF(sc, ATH_DEBUG_ANY, "%s: avp is NULL\n", __func__);
+               return NULL;
+       }
+       if (avp->av_bcbuf == NULL) {
+               DPRINTF(sc, ATH_DEBUG_ANY, "%s: av_bcbuf is NULL\n", __func__);
                return NULL;
        }
        bf = avp->av_bcbuf;
index 75874e327330553c9d78f000a54498ca3aa062ed..6a20940fba9113875ee0c9de871683a7b74afa5c 100644 (file)
@@ -702,7 +702,7 @@ ieee80211_sta_join(struct ieee80211vap *vap,
                if (ni == NULL) {
                        IEEE80211_DPRINTF(vap, IEEE80211_MSG_NODE,
                        "%s: Unable to allocate node for BSS: " MAC_FMT "\n", __func__,
-                       MAC_ADDR(ni->ni_macaddr));
+                       MAC_ADDR(se->se_macaddr));
                        return 0;
                }
        }