From: Thierry Reding <thierry.reding@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Stephen Warren <swarren@wwwdotorg.org>,
Linus Walleij <linus.walleij@linaro.org>,
Grant Likely <grant.likely@linaro.org>,
Rob Herring <robh+dt@kernel.org>,
linux-tegra@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch 1/2] pinctrl: tegra-xusb: fix an off by one test
Date: Thu, 31 Jul 2014 15:36:19 +0000 [thread overview]
Message-ID: <20140731153617.GA21098@ulmo.nvidia.com> (raw)
In-Reply-To: <20140731152217.GD31539@mwanda>
[-- Attachment #1: Type: text/plain, Size: 869 bytes --]
On Thu, Jul 31, 2014 at 06:22:17PM +0300, Dan Carpenter wrote:
> This shoudld be ">= ARRAY_SIZE()" instead of "> ARRAY_SIZE()".
>
> Fixes: dc0a39386687 ('pinctrl: Add NVIDIA Tegra XUSB pad controller support')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/pinctrl/pinctrl-tegra-xusb.c b/drivers/pinctrl/pinctrl-tegra-xusb.c
> index a066204..419a047 100644
> --- a/drivers/pinctrl/pinctrl-tegra-xusb.c
> +++ b/drivers/pinctrl/pinctrl-tegra-xusb.c
> @@ -680,7 +680,7 @@ static struct phy *tegra_xusb_padctl_xlate(struct device *dev,
> if (args->args_count <= 0)
> return ERR_PTR(-EINVAL);
>
> - if (index > ARRAY_SIZE(padctl->phys))
> + if (index >= ARRAY_SIZE(padctl->phys))
> return ERR_PTR(-EINVAL);
>
> return padctl->phys[index];
Good catch!
Acked-by: Thierry Reding <treding@nvidia.com>
[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Thierry Reding <thierry.reding@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Stephen Warren <swarren@wwwdotorg.org>,
Linus Walleij <linus.walleij@linaro.org>,
Grant Likely <grant.likely@linaro.org>,
Rob Herring <robh+dt@kernel.org>,
linux-tegra@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch 1/2] pinctrl: tegra-xusb: fix an off by one test
Date: Thu, 31 Jul 2014 17:36:19 +0200 [thread overview]
Message-ID: <20140731153617.GA21098@ulmo.nvidia.com> (raw)
In-Reply-To: <20140731152217.GD31539@mwanda>
[-- Attachment #1: Type: text/plain, Size: 869 bytes --]
On Thu, Jul 31, 2014 at 06:22:17PM +0300, Dan Carpenter wrote:
> This shoudld be ">= ARRAY_SIZE()" instead of "> ARRAY_SIZE()".
>
> Fixes: dc0a39386687 ('pinctrl: Add NVIDIA Tegra XUSB pad controller support')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/pinctrl/pinctrl-tegra-xusb.c b/drivers/pinctrl/pinctrl-tegra-xusb.c
> index a066204..419a047 100644
> --- a/drivers/pinctrl/pinctrl-tegra-xusb.c
> +++ b/drivers/pinctrl/pinctrl-tegra-xusb.c
> @@ -680,7 +680,7 @@ static struct phy *tegra_xusb_padctl_xlate(struct device *dev,
> if (args->args_count <= 0)
> return ERR_PTR(-EINVAL);
>
> - if (index > ARRAY_SIZE(padctl->phys))
> + if (index >= ARRAY_SIZE(padctl->phys))
> return ERR_PTR(-EINVAL);
>
> return padctl->phys[index];
Good catch!
Acked-by: Thierry Reding <treding@nvidia.com>
[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2014-07-31 15:36 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-31 15:22 [patch 1/2] pinctrl: tegra-xusb: fix an off by one test Dan Carpenter
2014-07-31 15:22 ` Dan Carpenter
2014-07-31 15:34 ` Stephen Warren
2014-07-31 15:34 ` Stephen Warren
2014-08-11 6:56 ` Linus Walleij
2014-08-11 6:56 ` Linus Walleij
2014-07-31 15:36 ` Thierry Reding [this message]
2014-07-31 15:36 ` Thierry Reding
2014-08-11 6:55 ` Linus Walleij
2014-08-11 6:55 ` Linus Walleij
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=20140731153617.GA21098@ulmo.nvidia.com \
--to=thierry.reding@gmail.com \
--cc=dan.carpenter@oracle.com \
--cc=grant.likely@linaro.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-tegra@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=swarren@wwwdotorg.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 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.