diff options
| author | Felix Fietkau <nbd@nbd.name> | 2024-10-02 11:56:30 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-11-08 16:22:02 +0100 |
| commit | c21efba8b5a86537ccdf43f77536bad02f82776c (patch) | |
| tree | 2d0279ba9a756c7bd238d920833fcbeac87b47aa /net | |
| parent | 1cfc329304617838dc06f021bbbde3bc79cd655e (diff) | |
| download | linux-c21efba8b5a86537ccdf43f77536bad02f82776c.tar.gz linux-c21efba8b5a86537ccdf43f77536bad02f82776c.tar.bz2 linux-c21efba8b5a86537ccdf43f77536bad02f82776c.zip | |
wifi: mac80211: do not pass a stopped vif to the driver in .get_txpower
commit 393b6bc174b0dd21bb2a36c13b36e62fc3474a23 upstream.
Avoid potentially crashing in the driver because of uninitialized private data
Fixes: 5b3dc42b1b0d ("mac80211: add support for driver tx power reporting")
Cc: stable@vger.kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Link: https://patch.msgid.link/20241002095630.22431-1-nbd@nbd.name
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
| -rw-r--r-- | net/mac80211/cfg.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index c8d2fe8fbc0a..f2629e56d1a5 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -2720,7 +2720,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) |
