On 2018-09-24 16:39, Kalle Valo wrote:
Dan Carpenter <[email protected]> writes:
tree: https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
pending
head: 2305dc3c6b1d66a7bef752439919d61478e02893
commit: 0c737c78082055ff589f6683e93b45f079c5d64e [39/55] ath10k: Add
support for configuring management packet rate
New smatch warnings:
drivers/net/wireless/ath/ath10k/mac.c:169
ath10k_mac_get_rate_hw_value() error: buffer overflow 'ath10k_rates'
12 <= 143
Old smatch warnings:
drivers/net/wireless/ath/ath10k/mac.c:170
ath10k_mac_get_rate_hw_value() error: buffer overflow 'ath10k_rates'
12 <= 143
#
https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/?id=0c737c78082055ff589f6683e93b45f079c5d64e
git remote add ath6kl
https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
git remote update ath6kl
git checkout 0c737c78082055ff589f6683e93b45f079c5d64e
vim +/ath10k_rates +169 drivers/net/wireless/ath/ath10k/mac.c
01cebe1c Michal Kazior 2015-03-30 159
0c737c78 Sriram R 2018-09-10 160 static int
ath10k_mac_get_rate_hw_value(int bitrate)
0c737c78 Sriram R 2018-09-10 161 {
0c737c78 Sriram R 2018-09-10 162 int i;
0c737c78 Sriram R 2018-09-10 163 u8 hw_value_prefix = 0;
0c737c78 Sriram R 2018-09-10 164
0c737c78 Sriram R 2018-09-10 165 if
(ath10k_mac_bitrate_is_cck(bitrate))
0c737c78 Sriram R 2018-09-10 166 hw_value_prefix =
WMI_RATE_PREAMBLE_CCK << 6;
0c737c78 Sriram R 2018-09-10 167
0c737c78 Sriram R 2018-09-10 168 for (i = 0; i <
sizeof(ath10k_rates); i++) {
^^^^^^^^^^^^^^^^^^^^
This should be ARRAY_SIZE(ath10k_rates) instead of sizeof().
Makes sense. Can someone submit a patch, please?
Hi Kalle, I've sent a v2 Patch with this change.
Thanks,
Sriram.R
_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k