linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pawel Moll <pawel.moll@arm.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	"linux-clk@vger.kernel.org" <linux-clk@vger.kernel.org>,
	"kernel-janitors@vger.kernel.org"
	<kernel-janitors@vger.kernel.org>
Subject: Re: [patch] clk: versatile: off by one in clk_sp810_timerclken_of_get()
Date: Wed, 29 Jul 2015 15:09:13 +0100	[thread overview]
Message-ID: <1438178953.2339.47.camel@arm.com> (raw)
In-Reply-To: <20150729101705.GB12100@mwanda>

On Wed, 2015-07-29 at 11:17 +0100, Dan Carpenter wrote:
> The ">" should be ">=" or we end up reading beyond the end of the array.
> 
> Fixes: 6e973d2c4385 ('clk: vexpress: Add separate SP810 driver')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/clk/versatile/clk-sp810.c b/drivers/clk/versatile/clk-sp810.c
> index 64b0129..7fbe4d4 100644
> --- a/drivers/clk/versatile/clk-sp810.c
> +++ b/drivers/clk/versatile/clk-sp810.c
> @@ -129,8 +129,8 @@ static struct clk *clk_sp810_timerclken_of_get(struct of_phandle_args *clkspec,
>  {
>  	struct clk_sp810 *sp810 = data;
>  
> -	if (WARN_ON(clkspec->args_count != 1 || clkspec->args[0] >
> -			ARRAY_SIZE(sp810->timerclken)))
> +	if (WARN_ON(clkspec->args_count != 1 ||
> +		    clkspec->args[0] >=	ARRAY_SIZE(sp810->timerclken)))
>  		return NULL;
>  
>  	return sp810->timerclken[clkspec->args[0]].clk;

Of course.

Acked-by: Pawel Moll <pawel.moll@arm.com>

Thanks!

Pawel


  reply	other threads:[~2015-07-29 14:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-29 10:17 [patch] clk: versatile: off by one in clk_sp810_timerclken_of_get() Dan Carpenter
2015-07-29 14:09 ` Pawel Moll [this message]
2015-07-29 18:25 ` Stephen Boyd

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=1438178953.2339.47.camel@arm.com \
    --to=pawel.moll@arm.com \
    --cc=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@codeaurora.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).