Commit 393b6bc1 authored by Felix Fietkau's avatar Felix Fietkau Committed by Johannes Berg
Browse files

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: 5b3dc42b ("mac80211: add support for driver tx power reporting")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
Link: https://patch.msgid.link/20241002095630.22431-1-nbd@nbd.name


Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 4cc6f3e5
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -3143,7 +3143,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)