diff options
author | David S. Miller <davem@davemloft.net> | 2015-08-17 17:03:10 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-08-17 17:03:10 -0400 |
commit | a27cc68b9bb25f16b37f9800e977927a2275e7e6 (patch) | |
tree | 5e5bb228db077bdfe28382de79578bfd52bdf48d /net | |
parent | 2902bc66fa7a6d959e033e5358fd836e2839b5db (diff) | |
parent | f5eeb5fa191fd7b634cbc4883ac58f3b2184dbc5 (diff) |
Merge tag 'mac80211-for-davem-2015-08-14' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211
Johannes Berg says:
====================
We have a single bugfix for an invalid memory read.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/rc80211_minstrel.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/net/mac80211/rc80211_minstrel.c b/net/mac80211/rc80211_minstrel.c index 247552a7f6c2..3ece7d1034c8 100644 --- a/net/mac80211/rc80211_minstrel.c +++ b/net/mac80211/rc80211_minstrel.c | |||
@@ -92,14 +92,15 @@ int minstrel_get_tp_avg(struct minstrel_rate *mr, int prob_ewma) | |||
92 | static inline void | 92 | static inline void |
93 | minstrel_sort_best_tp_rates(struct minstrel_sta_info *mi, int i, u8 *tp_list) | 93 | minstrel_sort_best_tp_rates(struct minstrel_sta_info *mi, int i, u8 *tp_list) |
94 | { | 94 | { |
95 | int j = MAX_THR_RATES; | 95 | int j; |
96 | struct minstrel_rate_stats *tmp_mrs = &mi->r[j - 1].stats; | 96 | struct minstrel_rate_stats *tmp_mrs; |
97 | struct minstrel_rate_stats *cur_mrs = &mi->r[i].stats; | 97 | struct minstrel_rate_stats *cur_mrs = &mi->r[i].stats; |
98 | 98 | ||
99 | while (j > 0 && (minstrel_get_tp_avg(&mi->r[i], cur_mrs->prob_ewma) > | 99 | for (j = MAX_THR_RATES; j > 0; --j) { |
100 | minstrel_get_tp_avg(&mi->r[tp_list[j - 1]], tmp_mrs->prob_ewma))) { | ||
101 | j--; | ||
102 | tmp_mrs = &mi->r[tp_list[j - 1]].stats; | 100 | tmp_mrs = &mi->r[tp_list[j - 1]].stats; |
101 | if (minstrel_get_tp_avg(&mi->r[i], cur_mrs->prob_ewma) <= | ||
102 | minstrel_get_tp_avg(&mi->r[tp_list[j - 1]], tmp_mrs->prob_ewma)) | ||
103 | break; | ||
103 | } | 104 | } |
104 | 105 | ||
105 | if (j < MAX_THR_RATES - 1) | 106 | if (j < MAX_THR_RATES - 1) |