Skip to content

Commit b0b862a

Browse files
nbd168gregkh
authored andcommitted
wifi: mac80211: do not pass a stopped vif to the driver in .get_txpower
commit 393b6bc upstream. 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]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent fe10c83 commit b0b862a

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
@@ -2443,7 +2443,8 @@ static int ieee80211_get_tx_power(struct wiphy *wiphy,
24432443
struct ieee80211_local *local = wiphy_priv(wiphy);
24442444
struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
24452445

2446-
if (local->ops->get_txpower)
2446+
if (local->ops->get_txpower &&
2447+
(sdata->flags & IEEE80211_SDATA_IN_DRIVER))
24472448
return drv_get_txpower(local, sdata, dbm);
24482449

24492450
if (!local->use_chanctx)

0 commit comments

Comments
 (0)