mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vivek Gautam <gautam.vivek@samsung.com>
To: Axel Lin <axel.lin@ingics.com>, Kishon Vijay Abraham I <kishon@ti.com>
Cc: linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org
Subject: Re: [PATCH] phy: exynos5-usbdrd: Fix off-by-one valid value checking for args->args[0]
Date: Mon, 02 Mar 2015 16:41:41 +0530	[thread overview]
Message-ID: <110D56A3356F4CB298E0690B183D50F0@sisodomain.com> (raw)
In-Reply-To: <1425051864.6032.1.camel@phoenix>

Hi,

On Friday, February 27, 2015 9:14 PM "Axel Lin" <axel.lin@ingics.com> wrote:
> Current code uses args->args[0] as array subscript of phy_drd->phys[].
> So the valid value range for args->args[0] is 0 ... EXYNOS5_DRDPHYS_NUM - 
> 1.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>

Reviewed by: Vivek Gautam <gautam.vivek@samsung.com>

> ---
> drivers/phy/phy-exynos5-usbdrd.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/phy/phy-exynos5-usbdrd.c 
> b/drivers/phy/phy-exynos5-usbdrd.c
> index 0437401..e2a0be7 100644
> --- a/drivers/phy/phy-exynos5-usbdrd.c
> +++ b/drivers/phy/phy-exynos5-usbdrd.c
> @@ -531,7 +531,7 @@ static struct phy *exynos5_usbdrd_phy_xlate(struct 
> device *dev,
> {
>  struct exynos5_usbdrd_phy *phy_drd = dev_get_drvdata(dev);
>
> - if (WARN_ON(args->args[0] > EXYNOS5_DRDPHYS_NUM))
> + if (WARN_ON(args->args[0] >= EXYNOS5_DRDPHYS_NUM))
>  return ERR_PTR(-ENODEV);
>
>  return phy_drd->phys[args->args[0]].phy;
> -- 
> 1.9.1
>

BRs
Vivek 


      reply	other threads:[~2015-03-02 11:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-27 15:44 Axel Lin
2015-03-02 11:11 ` Vivek Gautam [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=110D56A3356F4CB298E0690B183D50F0@sisodomain.com \
    --to=gautam.vivek@samsung.com \
    --cc=axel.lin@ingics.com \
    --cc=kishon@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.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

all inboxes | Powered by JetHome®