diff options
author | Dan Carpenter <[email protected]> | 2024-09-11 10:39:15 +0300 |
---|---|---|
committer | Arnd Bergmann <[email protected]> | 2024-09-12 14:33:12 +0000 |
commit | 53cf1dc480a5bdebad457cf6754ed3018b2533ba (patch) | |
tree | fd2afe7b625f216576eda3a7f7f8d61f3f726c47 /drivers/fpga/fpga-bridge.c | |
parent | e2a79105903a9122c2717515454f9c05dd9081e4 (diff) |
clk: ep93xx: Fix off by one in ep93xx_div_recalc_rate()
The psc->div[] array has psc->num_div elements. These values come from
when we call clk_hw_register_div(). It's adc_divisors and
ARRAY_SIZE(adc_divisors)) and so on. So this condition needs to be >=
instead of > to prevent an out of bounds read.
Fixes: 9645ccc7bd7a ("ep93xx: clock: convert in-place to COMMON_CLK")
Signed-off-by: Dan Carpenter <[email protected]>
Acked-by: Alexander Sverdlin <[email protected]>
Reviewed-by: Nikita Shubin <[email protected]>
Signed-off-by: Alexander Sverdlin <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[arnd: the original patch was for arch/arm/mach-ep93xx/clock.c,
but the same bug ended up in arch/arm/mach-ep93xx/clock.c.
Signed-off-by: Arnd Bergmann <[email protected]>
Diffstat (limited to 'drivers/fpga/fpga-bridge.c')
0 files changed, 0 insertions, 0 deletions