Fix dereferencing NULL in debug messages

Found by coccinelle.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@4154 0192ed92-7a03-0410-a25b-9323aeb14dbd
This commit is contained in:
proski 2011-08-03 00:36:39 +00:00
parent 4f8410ce13
commit ccf1970ea8
2 changed files with 7 additions and 5 deletions

View 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;

View 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;
}
}