From: Dhyan K Prajapati <dhyan19022009@gmail.com>
To: Lachlan Hodges <lachlan.hodges@morsemicro.com>,
Johannes Berg <johannes@sipsolutions.net>
Cc: Krzysztof Kozlowski <krzk@kernel.org>,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
Dhyan K Prajapati <dhyan19022009@gmail.com>,
Dhyan K Prajapati <dhyan1902209@gmail.com>
Subject: [PATCH wireless] wifi: mac80211: skip BSS_CHANGED_TXPOWER for monitor interfaces
Date: Sat, 7 Feb 2026 16:32:24 +0530 [thread overview]
Message-ID: <20260207110224.32755-1-dhyan19022009@gmail.com> (raw)
Monitor mode interfaces do not maintain a BSS context, since a commit in
July 2025 monitor interfaces with WANT_MONITOR_VIF began receiving link
change notification duing ieee80211_add_vitual_monitor(), when
ieee_assign_link_chanctx() assigns a channel context, it triggers
ieee80211_recalc_txpower() this sends a bss_info_changed callback
receive link->conf as the bss_conf prameter, in monitor mode it isn't
initialised leading to NULL pointer dereference in drivers like iwldvm,
as BSS_CHANGED_TXPOWER is not applicable for monitor mode we can just
skip it.
Fixes: c57e5b9819df ("wifi: mac80211: fix WARN_ON for monitor mode on some devices")
Tested-by: Dhyan K Prajapati <dhyan1902209@gmail.com>
Signed-off-by: Dhyan K Prajapati <dhyan19022009@gmail.com>
---
net/mac80211/iface.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 515384ca2..47f6bef0e 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -76,8 +76,9 @@ bool __ieee80211_recalc_txpower(struct ieee80211_link_data *link)
void ieee80211_recalc_txpower(struct ieee80211_link_data *link,
bool update_bss)
{
- if (__ieee80211_recalc_txpower(link) ||
- (update_bss && ieee80211_sdata_running(link->sdata)))
+ if (link->sdata->vif.type != NL80211_IFTYPE_MONITOR &&
+ (__ieee80211_recalc_txpower(link) ||
+ (update_bss && ieee80211_sdata_running(link->sdata))))
ieee80211_link_info_change_notify(link->sdata, link,
BSS_CHANGED_TXPOWER);
}
--
2.43.0
next reply other threads:[~2026-02-07 11:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-07 11:02 Dhyan K Prajapati [this message]
2026-02-07 11:06 ` [PATCH wireless] wifi: mac80211: skip BSS_CHANGED_TXPOWER for monitor interfaces Krzysztof Kozlowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260207110224.32755-1-dhyan19022009@gmail.com \
--to=dhyan19022009@gmail.com \
--cc=dhyan1902209@gmail.com \
--cc=johannes@sipsolutions.net \
--cc=krzk@kernel.org \
--cc=lachlan.hodges@morsemicro.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox