aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/cfg.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r--net/mac80211/cfg.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 7a6f8aba5c46..d44dca56b8ff 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -3191,14 +3191,24 @@ static int ieee80211_set_csa_beacon(struct ieee80211_sub_if_data *sdata,
3191 if (params->count <= 1) 3191 if (params->count <= 1)
3192 break; 3192 break;
3193 3193
3194 sdata->csa_counter_offset_beacon = 3194 if ((params->n_counter_offsets_beacon >
3195 params->counter_offsets_beacon[0]; 3195 IEEE80211_MAX_CSA_COUNTERS_NUM) ||
3196 (params->n_counter_offsets_presp >
3197 IEEE80211_MAX_CSA_COUNTERS_NUM))
3198 return -EINVAL;
3196 3199
3197 if (params->n_counter_offsets_presp) 3200 /* make sure we don't have garbage in other counters */
3198 sdata->csa_counter_offset_presp = 3201 memset(sdata->csa_counter_offset_beacon, 0,
3199 params->counter_offsets_presp[0]; 3202 sizeof(sdata->csa_counter_offset_beacon));
3200 else 3203 memset(sdata->csa_counter_offset_presp, 0,
3201 sdata->csa_counter_offset_presp = 0; 3204 sizeof(sdata->csa_counter_offset_presp));
3205
3206 memcpy(sdata->csa_counter_offset_beacon,
3207 params->counter_offsets_beacon,
3208 params->n_counter_offsets_beacon * sizeof(u16));
3209 memcpy(sdata->csa_counter_offset_presp,
3210 params->counter_offsets_presp,
3211 params->n_counter_offsets_presp * sizeof(u16));
3202 3212
3203 err = ieee80211_assign_beacon(sdata, &params->beacon_csa); 3213 err = ieee80211_assign_beacon(sdata, &params->beacon_csa);
3204 if (err < 0) { 3214 if (err < 0) {