Skip to content

Commit

Permalink
Merge tag 'mac80211-for-john-2014-11-18' of git://git.kernel.org/pub/…
Browse files Browse the repository at this point in the history
…scm/linux/kernel/git/jberg/mac80211

Johannes Berg <[email protected]> says:

"Here's another last minute fix, for minstrel HT crashing
depending on the value of some uninitialised stack."

Signed-off-by: John W. Linville <[email protected]>
  • Loading branch information
linvjw committed Nov 19, 2014
2 parents 4c69f05 + 280ba51 commit 6158fb3
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions net/mac80211/rc80211_minstrel_ht.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,19 +252,16 @@ minstrel_ht_sort_best_tp_rates(struct minstrel_ht_sta *mi, u8 index,
cur_thr = mi->groups[cur_group].rates[cur_idx].cur_tp;
cur_prob = mi->groups[cur_group].rates[cur_idx].probability;

tmp_group = tp_list[j - 1] / MCS_GROUP_RATES;
tmp_idx = tp_list[j - 1] % MCS_GROUP_RATES;
tmp_thr = mi->groups[tmp_group].rates[tmp_idx].cur_tp;
tmp_prob = mi->groups[tmp_group].rates[tmp_idx].probability;

while (j > 0 && (cur_thr > tmp_thr ||
(cur_thr == tmp_thr && cur_prob > tmp_prob))) {
j--;
do {
tmp_group = tp_list[j - 1] / MCS_GROUP_RATES;
tmp_idx = tp_list[j - 1] % MCS_GROUP_RATES;
tmp_thr = mi->groups[tmp_group].rates[tmp_idx].cur_tp;
tmp_prob = mi->groups[tmp_group].rates[tmp_idx].probability;
}
if (cur_thr < tmp_thr ||
(cur_thr == tmp_thr && cur_prob <= tmp_prob))
break;
j--;
} while (j > 0);

if (j < MAX_THR_RATES - 1) {
memmove(&tp_list[j + 1], &tp_list[j], (sizeof(*tp_list) *
Expand Down

0 comments on commit 6158fb3

Please sign in to comment.