]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
soc: qcom: geni-se: fix array underflow in geni_se_clk_tbl_get()
authorDan Carpenter <dan.carpenter@linaro.org>
Mon, 30 Sep 2024 07:51:31 +0000 (10:51 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2024 18:50:47 +0000 (19:50 +0100)
commitf4b7bf5a50f1fa25560f0b66a13563465542861b
treef080c7b12721cb40ec7a5f79d7b642467d6b6347
parentf34d172307f9d27e482a6c8b464bd36fe6e98672
soc: qcom: geni-se: fix array underflow in geni_se_clk_tbl_get()

[ Upstream commit 78261cb08f06c93d362cab5c5034bf5899bc7552 ]

This loop is supposed to break if the frequency returned from
clk_round_rate() is the same as on the previous iteration.  However,
that check doesn't make sense on the first iteration through the loop.
It leads to reading before the start of these->clk_perf_tbl[] array.

Fixes: eddac5af0654 ("soc: qcom: Add GENI based QUP Wrapper driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/8cd12678-f44a-4b16-a579-c8f11175ee8c@stanley.mountain
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/soc/qcom/qcom-geni-se.c