Files
u-boot-krane/drivers
Wayen YanandTom Rini fdfe2ec48d clk: airoha: fix off-by-one in clock ID boundary check
The boundary checks in airoha_clk_enable(), airoha_clk_get_rate(), and
airoha_clk_set_rate() use "id > data->num_clocks" which allows id equal
to num_clocks to pass. Since data->descs[] has exactly num_clocks entries
(indices 0 to num_clocks-1), id=num_clocks results in an out-of-bounds
array access.

This is currently not triggered because the device tree clock IDs are
within bounds, but the check should be defensive. Fix by changing the
comparison from ">" to ">=".

Fixes: d0b81afb5e ("clk: airoha: Add support for Airoha AN7581 SoC clock")
Signed-off-by: Wayen Yan <win847@gmail.com>
2026-07-17 14:50:35 -06:00
..
2026-06-25 15:00:58 -06:00
2026-06-25 15:00:58 -06:00
2026-06-25 15:00:58 -06:00
2026-06-25 15:00:58 -06:00
2026-06-25 15:00:58 -06:00
2026-06-25 15:00:58 -06:00
2026-07-01 11:42:52 +02:00
2026-06-25 15:00:58 -06:00
2026-06-25 15:00:58 -06:00
2026-06-25 15:00:58 -06:00
2026-07-06 18:26:12 -06:00