Skip to content

Commit

Permalink
wifi: mac80211: do not pass a stopped vif to the driver in .get_txpower
Browse files Browse the repository at this point in the history
commit 393b6bc174b0dd21bb2a36c13b36e62fc3474a23 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]>
  • Loading branch information
nbd168 authored and Avenger-285714 committed Nov 11, 2024
1 parent 780a059 commit 9f66994
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/mac80211/cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -3115,7 +3115,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->use_chanctx)
Expand Down

0 comments on commit 9f66994

Please sign in to comment.