mac80211: fix order of setting ch_switch and drv_pre_channel_switch call
authorLuciano Coelho <luciano.coelho@intel.com>
Fri, 7 Nov 2014 13:28:33 +0000 (15:28 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 10 Nov 2014 09:17:42 +0000 (10:17 +0100)
There was a mistake when merging commit 6d027bcc (mac80211: add
pre_channel_switch driver operation) for upstream.  The assignment of
the values in the ch_switch structure came below the call to
drv_pre_channel_switch.  Fix the order.

Fixes: 6d027bcc (mac80211: add pre_channel_switch driver operation)
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/cfg.c

index 06185940cbb66a3abf35230ce92b03c7716248a1..76e794edd96026f77fb6ff1574529cb2b7bb8380 100644 (file)
@@ -3158,6 +3158,12 @@ __ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev,
                goto out;
        }
 
+       ch_switch.timestamp = 0;
+       ch_switch.device_timestamp = 0;
+       ch_switch.block_tx = params->block_tx;
+       ch_switch.chandef = params->chandef;
+       ch_switch.count = params->count;
+
        err = drv_pre_channel_switch(sdata, &ch_switch);
        if (err)
                goto out;
@@ -3175,12 +3181,6 @@ __ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev,
                goto out;
        }
 
-       ch_switch.timestamp = 0;
-       ch_switch.device_timestamp = 0;
-       ch_switch.block_tx = params->block_tx;
-       ch_switch.chandef = params->chandef;
-       ch_switch.count = params->count;
-
        err = ieee80211_set_csa_beacon(sdata, params, &changed);
        if (err) {
                ieee80211_vif_unreserve_chanctx(sdata);