]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
mac80211: Remove WARN_ON_ONCE in ieee80211_recalc_smps
authorAndrei Otcheretianski <andrei.otcheretianski@intel.com>
Sun, 25 Oct 2015 08:59:40 +0000 (10:59 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 3 Nov 2015 09:41:02 +0000 (10:41 +0100)
The recalc_smps work can run after the station disassociates.
At this stage we already released the channel, but the work
will be cancelled only when the interface stops.
In this scenario we can hit the warning in ieee80211_recalc_smps, so
just remove it.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/util.c

index 7f7ddc527baab0c36c67cb4bc87c10a8aa3e0e39..b0e3a4248bd592f2522b3627d268af36e17eea1b 100644 (file)
@@ -2151,7 +2151,13 @@ void ieee80211_recalc_smps(struct ieee80211_sub_if_data *sdata)
        chanctx_conf = rcu_dereference_protected(sdata->vif.chanctx_conf,
                                        lockdep_is_held(&local->chanctx_mtx));
 
-       if (WARN_ON_ONCE(!chanctx_conf))
+       /*
+        * This function can be called from a work, thus it may be possible
+        * that the chanctx_conf is removed (due to a disconnection, for
+        * example).
+        * So nothing should be done in such case.
+        */
+       if (!chanctx_conf)
                goto unlock;
 
        chanctx = container_of(chanctx_conf, struct ieee80211_chanctx, conf);