mac80211: fix invalid read in minstrel_sort_best_tp_rates()
authorAdrien Schildknecht <adrien+dev@schischi.me>
Tue, 28 Jul 2015 08:30:16 +0000 (10:30 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 13 Aug 2015 11:52:34 +0000 (13:52 +0200)
commitf5eeb5fa191fd7b634cbc4883ac58f3b2184dbc5
tree9749e71358a173faba86a0188fc5a4a787ba1aaa
parent923b352f19d9ea971ae2536eab55f5fc9e95fedf
mac80211: fix invalid read in minstrel_sort_best_tp_rates()

At the last iteration of the loop, j may equal zero and thus
tp_list[j - 1] causes an invalid read.
Change the logic of the loop so that j - 1 is always >= 0.

Cc: stable@vger.kernel.org
Signed-off-by: Adrien Schildknecht <adrien+dev@schischi.me>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/rc80211_minstrel.c