aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2022-12-21 18:45:45 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2023-05-03 00:12:50 +0000
commit64313140e531622eaa5e858e8d22c663efb83d19 (patch)
treedde9d477ece18308c74ffac64b468091317159e6
parent256b5d40e5502323dddffd5a8db2ab431e9eea61 (diff)
iee80211_hwmp: Don't dereference NULL ni in debug printf.
In this call to IEEE80211_NOTE, ni is always NULL due to the assignment a few lines earlier at the start of the function. If debug traces are enabled, then this will pass an invalid pointer as the 'mac' pointer to ieee80211_note_mac. Use IEEE80211_DPRINTF which doesn't take a 'ni' argument instead. Reported by: GCC -Wstringop-overread Reviewed by: bz, emaste Differential Revision: https://reviews.freebsd.org/D37626 (cherry picked from commit 95d146592f5ee3fa998496713f28475e65996ff9)
-rw-r--r--sys/net80211/ieee80211_hwmp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/net80211/ieee80211_hwmp.c b/sys/net80211/ieee80211_hwmp.c
index 77ba218ccd50..ad3de543664f 100644
--- a/sys/net80211/ieee80211_hwmp.c
+++ b/sys/net80211/ieee80211_hwmp.c
@@ -1928,8 +1928,8 @@ hwmp_discover(struct ieee80211vap *vap,
if (rt == NULL) {
rt = ieee80211_mesh_rt_add(vap, dest);
if (rt == NULL) {
- IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP,
- ni, "unable to add discovery path to %6D",
+ IEEE80211_DPRINTF(vap, IEEE80211_MSG_HWMP,
+ "unable to add discovery path to %6D",
dest, ":");
vap->iv_stats.is_mesh_rtaddfailed++;
goto done;