Out of bounds access in arch/arm/cpu/armv7/iproc-common/armpll.c
Scott Branden
scott.branden at broadcom.com
Mon Jun 22 21:03:42 CEST 2020
Hi Heinrich,
On 2020-06-06 3:51 p.m., Heinrich Schuchardt wrote:
> Hello Scott,
>
> CppCheck gives an error:
>
> [arch/arm/cpu/armv7/iproc-common/armpll.c:137]: (error) Array
> 'armpll_clk_tab[13]' accessed at index 17, which is out of bounds.
>
> In the loop at the start of armpll_config() i is determined. The maximum
> value of i after checking status in line 53 is 12.
>
> In line 137 your code accesses
>
> armpll_clk_tab[i+4].freqid
>
> The patch where you introduced the code dates from 2014. But hopefully
> you still remember what you intended to do in that line.
I have checked with our tree. There is a bug in the code and the +4
could be deleted.
But, the file armpll.c should simply be deleted and removed from the
Makefile. This was already
done years ago in our internal tree.
There is no need for uboot to have control over these pll settings.
>
> Best regards
>
> Heinrich
Regards,
Scott
More information about the U-Boot
mailing list