Skip to content
Commit 6827aba3 authored by Samuel Holland's avatar Samuel Holland Committed by Andre Przywara
Browse files

clk: sunxi: Prevent out-of-bounds gate array access



Because the gate arrays are not given explicit sizes, the arrays are
only as large as the highest-numbered gate described in the driver.
However, only a subset of the CCU clocks are needed by U-Boot. So there
are valid clock specifiers with indexes greater than the size of the
arrays. Referencing any of these clocks causes out-of-bounds access.
Fix this by checking the identifier against the size of the array.

Fixes: 0d47bc70 ("clk: Add Allwinner A64 CLK driver")
Signed-off-by: default avatarSamuel Holland <samuel@sholland.org>
Reviewed-by: default avatarAndre Przywara <andre.przywara@arm.com>
Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
parent 49b2b0a2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment