Commit 6eab46e2 authored by Dan Carpenter's avatar Dan Carpenter Committed by sanglipeng
Browse files

wifi: ath5k: fix an off by one check in ath5k_eeprom_read_freq_list()

stable inclusion
from stable-v5.10.180
commit 6c91b3b57b1f5aed73053e8992a6badc907218d3
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8DDFN

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=6c91b3b57b1f5aed73053e8992a6badc907218d3



--------------------------------

[ Upstream commit 4c856ee1 ]

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: 1048643e ("ath5k: Clean up eeprom parsing and add missing calibration data")
Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Reviewed-by: default avatarLuis Chamberlain <mcgrof@kernel.org>
Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/Y+D9hPQrHfWBJhXz@kili


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent db506d53
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment