]> git.baikalelectronics.ru Git - kernel.git/commit
wifi: ath5k: fix an off by one check in ath5k_eeprom_read_freq_list()
authorDan Carpenter <error27@gmail.com>
Mon, 6 Feb 2023 13:15:48 +0000 (16:15 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 May 2023 09:35:40 +0000 (11:35 +0200)
commit72665ae56af3a987cc29ac3b301fe486d2d3e049
tree6b849d19b47e0707c43ba6aa447f5da8f0eb545a
parentf29400f39c038aa4ef9ac4cc5990c45f6ca04a29
wifi: ath5k: fix an off by one check in ath5k_eeprom_read_freq_list()

[ Upstream commit 4c856ee12df85aabd437c3836ed9f68d94268358 ]

This loop checks that i < max at the start of loop but then it does
i++ which could put it past the end of the array.  It's harmless to
check again and prevent a potential out of bounds.

Fixes: a88f6bb64b3c ("ath5k: Clean up eeprom parsing and add missing calibration data")
Signed-off-by: Dan Carpenter <error27@gmail.com>
Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/Y+D9hPQrHfWBJhXz@kili
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/ath/ath5k/eeprom.c