wifi: mac80211: do not pass a stopped vif to the driver in .get_txpower
Subsystems (2)
PATCH 1/1 wifi: mac80211: do not pass a stopped vif to the driver in .get_txpower
Avoid potentially crashing in the driver because of uninitialized private data
Fixes 5b3dc42b1b0d ("mac80211: add support for driver tx power reporting")
Signed-off-by Felix Fietkau <[email protected]>
--- net/mac80211/cfg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/mac80211/cfg.c +2 -1
@@ -3138,7 +3138,8 @@ static int ieee80211_get_tx_power(struct wiphy *wiphy,struct ieee80211_local *local =wiphy_priv (wiphy);struct ieee80211_sub_if_data *sdata =IEEE80211_WDEV_TO_SUB_IF (wdev); -if (local->ops->get_txpower) +if (local->ops->get_txpower && + (sdata->flags &IEEE80211_SDATA_IN_DRIVER ))return drv_get_txpower (local, sdata, dbm);if (local->emulate_chanctx)
Signature · 1 line
2.46.0