mac80211: ensure we don't update tx power on a non-running sdata
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Tue, 17 Nov 2015 08:24:39 +0000 (10:24 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 20 Nov 2015 10:38:50 +0000 (11:38 +0100)
We can't update the Tx power on the device unless it is
running.

This fixes https://bugzilla.kernel.org/show_bug.cgi?id=101521.

Cc: stable@vger.kernel.org
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/iface.c

index d0dc1bfaeec2d5440573d114b98e16099616f43d..53ee049efbffbeae5ce87220a5ffdcb4937b2fb3 100644 (file)
@@ -76,7 +76,8 @@ bool __ieee80211_recalc_txpower(struct ieee80211_sub_if_data *sdata)
 void ieee80211_recalc_txpower(struct ieee80211_sub_if_data *sdata,
                              bool update_bss)
 {
-       if (__ieee80211_recalc_txpower(sdata) || update_bss)
+       if (__ieee80211_recalc_txpower(sdata) ||
+           (update_bss && ieee80211_sdata_running(sdata)))
                ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_TXPOWER);
 }