From: proski Date: Wed, 3 Aug 2011 00:36:39 +0000 (+0000) Subject: Fix dereferencing NULL in debug messages X-Git-Url: http://git.ozo.com/?p=madwifi%2F.git;a=commitdiff_plain;h=ccf1970ea830e737c5f89cc87f54ae68139a810f;hp=4f8410ce1376d1b10b35a33af99ac28b03bf3055 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 --- diff --git a/ath/if_ath.c b/ath/if_ath.c index ed8d3e9..8d0716d 100644 --- a/ath/if_ath.c +++ b/ath/if_ath.c @@ -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; diff --git a/net80211/ieee80211_node.c b/net80211/ieee80211_node.c index 75874e3..6a20940 100644 --- a/net80211/ieee80211_node.c +++ b/net80211/ieee80211_node.c @@ -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; } }