Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6158fb37 authored by John W. Linville's avatar John W. Linville
Browse files

Merge tag 'mac80211-for-john-2014-11-18' of...

Merge tag 'mac80211-for-john-2014-11-18' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211



Johannes Berg <johannes@sipsolutions.net> says:

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

Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parents 4c69f05e 280ba51d
Loading
Loading
Loading
Loading
+6 −9
Original line number Diff line number Diff line
@@ -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;

	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;

	while (j > 0 && (cur_thr > tmp_thr ||
	      (cur_thr == tmp_thr && cur_prob > tmp_prob))) {
		if (cur_thr < tmp_thr ||
		    (cur_thr == tmp_thr && cur_prob <= tmp_prob))
			break;
		j--;
		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);

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