linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: grant.likely@secretlab.ca (Grant Likely)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] gpio: Fix range check in of_gpio_simple_xlate()
Date: Fri, 06 Apr 2012 20:45:30 -0700	[thread overview]
Message-ID: <20120407034530.373A13E23DE@localhost> (raw)
In-Reply-To: <1333497778-26925-1-git-send-email-stigge@antcom.de>

On Wed,  4 Apr 2012 02:02:58 +0200, Roland Stigge <stigge@antcom.de> wrote:
> This patch fixes a range check in of_gpio_simple_xlate() by replacing a
> "> gc->ngpio" with ">= gc->ngpio" since range is from 0 to gc->ngpio - 1
> 
> Signed-off-by: Roland Stigge <stigge@antcom.de>

Applied, thanks.

g.

> 
> ---
> 
>  Applies to v3.4-rc1
> 
>  drivers/of/gpio.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- linux-2.6.orig/drivers/of/gpio.c
> +++ linux-2.6/drivers/of/gpio.c
> @@ -140,7 +140,7 @@ int of_gpio_simple_xlate(struct gpio_chi
>  	if (WARN_ON(gpiospec->args_count < gc->of_gpio_n_cells))
>  		return -EINVAL;
>  
> -	if (gpiospec->args[0] > gc->ngpio)
> +	if (gpiospec->args[0] >= gc->ngpio)
>  		return -EINVAL;
>  
>  	if (flags)

-- 
Grant Likely, B.Sc, P.Eng.
Secret Lab Technologies,Ltd.

      parent reply	other threads:[~2012-04-07  3:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-04  0:02 [PATCH] gpio: Fix range check in of_gpio_simple_xlate() Roland Stigge
2012-04-04  0:11 ` Roland Stigge
2012-04-07  3:45 ` Grant Likely [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=20120407034530.373A13E23DE@localhost \
    --to=grant.likely@secretlab.ca \
    --cc=linux-arm-kernel@lists.infradead.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).