mac80211: move clearing result into ieee80211_parse_ch_switch_ie()
authorJohannes Berg <johannes.berg@intel.com>
Fri, 19 May 2017 11:22:38 +0000 (13:22 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 19 May 2017 11:25:57 +0000 (13:25 +0200)
Clear the csa_ie in ieee80211_parse_ch_switch_ie() where the data
is filled in, rather than in each caller.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/ibss.c
net/mac80211/mesh.c
net/mac80211/mlme.c
net/mac80211/spectmgmt.c

index 364d4e13764942db0b41eee7a9561b3c00e946ae..660ac6a426f43218bd9b35cc2fbea9751b4e5915 100644 (file)
@@ -808,7 +808,6 @@ ieee80211_ibss_process_chanswitch(struct ieee80211_sub_if_data *sdata,
        }
 
        memset(&params, 0, sizeof(params));
-       memset(&csa_ie, 0, sizeof(csa_ie));
        err = ieee80211_parse_ch_switch_ie(sdata, elems,
                                           ifibss->chandef.chan->band,
                                           sta_flags, ifibss->bssid, &csa_ie);
index 3702e3d9141ddb9135cbcb7c7fccb9102a072763..f7dffdf5fc748391c4f76d44fbc0bf7037a48e3c 100644 (file)
@@ -960,7 +960,6 @@ ieee80211_mesh_process_chnswitch(struct ieee80211_sub_if_data *sdata,
        }
 
        memset(&params, 0, sizeof(params));
-       memset(&csa_ie, 0, sizeof(csa_ie));
        err = ieee80211_parse_ch_switch_ie(sdata, elems, sband->band,
                                           sta_flags, sdata->vif.addr,
                                           &csa_ie);
index 0ea9712bd99ea698f40b068d5ee31a69133224a3..1ae9be090309342ccc534394fa875e5859529551 100644 (file)
@@ -1126,7 +1126,6 @@ ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata,
                return;
 
        current_band = cbss->channel->band;
-       memset(&csa_ie, 0, sizeof(csa_ie));
        res = ieee80211_parse_ch_switch_ie(sdata, elems, current_band,
                                           ifmgd->flags,
                                           ifmgd->associated->bssid, &csa_ie);
index d2ea0017c79d707029b6a3fda23a478d8dd1ced5..bf8f5dcea1c4db29e97944f0aaf60c27c7ea4e56 100644 (file)
@@ -36,6 +36,8 @@ int ieee80211_parse_ch_switch_ie(struct ieee80211_sub_if_data *sdata,
        const struct ieee80211_wide_bw_chansw_ie *wide_bw_chansw_ie;
        int secondary_channel_offset = -1;
 
+       memset(csa_ie, 0, sizeof(*csa_ie));
+
        sec_chan_offs = elems->sec_chan_offs;
        wide_bw_chansw_ie = elems->wide_bw_chansw_ie;