All of lore.kernel.org
 help / color / mirror / Atom feed
From: Scott Branden <scott.branden@broadcom.com>
To: u-boot@lists.denx.de
Subject: Out of bounds access in arch/arm/cpu/armv7/iproc-common/armpll.c
Date: Mon, 22 Jun 2020 12:03:42 -0700	[thread overview]
Message-ID: <e39116c8-f9e7-f949-0df8-a02fac8b9372@broadcom.com> (raw)
In-Reply-To: <4d0c4259-39a4-5805-2ed8-112daefc241b@gmx.de>

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

      reply	other threads:[~2020-06-22 19:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-06 22:51 Out of bounds access in arch/arm/cpu/armv7/iproc-common/armpll.c Heinrich Schuchardt
2020-06-22 19:03 ` Scott Branden [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e39116c8-f9e7-f949-0df8-a02fac8b9372@broadcom.com \
    --to=scott.branden@broadcom.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.