ath10k: fix possible out of bound access of ath10k_rates array
authorSriram R <srirrama@codeaurora.org>
Wed, 3 Oct 2018 03:13:50 +0000 (08:43 +0530)
committerKalle Valo <kvalo@codeaurora.org>
Sat, 13 Oct 2018 17:15:32 +0000 (20:15 +0300)
commit34e141eea7dd8525dd1ef7a925459e455b4d307f
tree789116b92732dde66f548ec7a89254af65336ba1
parent9434dca95117c493575ab1bd255d323dabf4184a
ath10k: fix possible out of bound access of ath10k_rates array

While using 'ath10k_mac_get_rate_hw_value()' to obtain the hw value
from the passed bitrate, there is a chance of out of bound array access
when wrong bitrate is passed. This is fixed by comparing the bitrates
within the correct size of the ath10k_rates array.

Fixes commit f279294e9ee2 ("ath10k: add support for configuring management
packet rate"). Also correction made to some indents used in the above commit.

Signed-off-by: Sriram R <srirrama@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ath/ath10k/mac.c