Skip to content

Commit 393b6bc

Browse files
nbd168jmberg-intel
authored andcommitted
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: 5b3dc42 ("mac80211: add support for driver tx power reporting") Cc: [email protected] Signed-off-by: Felix Fietkau <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Johannes Berg <[email protected]>
1 parent 4cc6f3e commit 393b6bc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/mac80211/cfg.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3143,7 +3143,8 @@ static int ieee80211_get_tx_power(struct wiphy *wiphy,
31433143
struct ieee80211_local *local = wiphy_priv(wiphy);
31443144
struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
31453145

3146-
if (local->ops->get_txpower)
3146+
if (local->ops->get_txpower &&
3147+
(sdata->flags & IEEE80211_SDATA_IN_DRIVER))
31473148
return drv_get_txpower(local, sdata, dbm);
31483149

31493150
if (local->emulate_chanctx)

0 commit comments

Comments
 (0)