[PATCH] arm: rmobile: Fix off-by-one error in cpuinfo

Marek Vasut marek.vasut at mailbox.org
Sat Aug 19 16:32:21 CEST 2023


On 8/18/23 15:17, Paul Barker wrote:
> In rmobile_cpuinfo_idx() there is an off-by-one error in accessing the
> rmobile_cpuinfo array.
> 
> At the end of the loop, i is equal to the array size, i.e.
> rmobile_cpuinfo[i] accesses one entry past the end of the array. The
> last entry in the array is a fallback value so the loop should count to
> ARRAY_SIZE(rmobile_cpuinfo) - 1 instead, this will leave i equal to the
> index of the fallback value if no match is found.
> 
> Signed-off-by: Paul Barker <paul.barker.ct at bp.renesas.com>
> Reviewed-by: Biju Das <biju.das.jz at bp.renesas.com>

Reviewed-by: Marek Vasut <marek.vasut+renesas at mailbox.org>


More information about the U-Boot mailing list