All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Daney <ddaney.cavm@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Ralf Baechle <ralf@linux-mips.org>,
	David Daney <david.daney@cavium.com>,
	Rob Herring <robh@kernel.org>,
	Marc Zyngier <marc.zyngier@arm.com>,
	linux-mips@linux-mips.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] MIPS: OCTEON: Off by one in octeon_irq_gpio_map()
Date: Thu, 14 Jul 2016 15:38:46 +0000	[thread overview]
Message-ID: <5787B206.3030902@gmail.com> (raw)
In-Reply-To: <20160714101429.GA18175@mwanda>

On 07/14/2016 03:14 AM, Dan Carpenter wrote:
> It should be >= ARRAY_SIZE() instead of > ARRAY_SIZE().
>
> Fixes: 64b139f97c01 ('MIPS: OCTEON: irq: add CIB and other fixes')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Good catch.  This would probably only matter if a malformed device tree, 
or buggy device driver were encountered.

Acked-by: David Daney <david.daney@cavium.com>


>
> diff --git a/arch/mips/cavium-octeon/octeon-irq.c b/arch/mips/cavium-octeon/octeon-irq.c
> index 368eb49..75a4add 100644
> --- a/arch/mips/cavium-octeon/octeon-irq.c
> +++ b/arch/mips/cavium-octeon/octeon-irq.c
> @@ -1260,7 +1260,7 @@ static int octeon_irq_gpio_map(struct irq_domain *d,
>
>   	line = (hw + gpiod->base_hwirq) >> 6;
>   	bit = (hw + gpiod->base_hwirq) & 63;
> -	if (line > ARRAY_SIZE(octeon_irq_ciu_to_irq) ||
> +	if (line >= ARRAY_SIZE(octeon_irq_ciu_to_irq) ||
>   		octeon_irq_ciu_to_irq[line][bit] != 0)
>   		return -EINVAL;
>
>


WARNING: multiple messages have this Message-ID (diff)
From: David Daney <ddaney.cavm@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Ralf Baechle <ralf@linux-mips.org>,
	David Daney <david.daney@cavium.com>,
	Rob Herring <robh@kernel.org>,
	Marc Zyngier <marc.zyngier@arm.com>,
	linux-mips@linux-mips.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] MIPS: OCTEON: Off by one in octeon_irq_gpio_map()
Date: Thu, 14 Jul 2016 08:38:46 -0700	[thread overview]
Message-ID: <5787B206.3030902@gmail.com> (raw)
In-Reply-To: <20160714101429.GA18175@mwanda>

On 07/14/2016 03:14 AM, Dan Carpenter wrote:
> It should be >= ARRAY_SIZE() instead of > ARRAY_SIZE().
>
> Fixes: 64b139f97c01 ('MIPS: OCTEON: irq: add CIB and other fixes')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Good catch.  This would probably only matter if a malformed device tree, 
or buggy device driver were encountered.

Acked-by: David Daney <david.daney@cavium.com>


>
> diff --git a/arch/mips/cavium-octeon/octeon-irq.c b/arch/mips/cavium-octeon/octeon-irq.c
> index 368eb49..75a4add 100644
> --- a/arch/mips/cavium-octeon/octeon-irq.c
> +++ b/arch/mips/cavium-octeon/octeon-irq.c
> @@ -1260,7 +1260,7 @@ static int octeon_irq_gpio_map(struct irq_domain *d,
>
>   	line = (hw + gpiod->base_hwirq) >> 6;
>   	bit = (hw + gpiod->base_hwirq) & 63;
> -	if (line > ARRAY_SIZE(octeon_irq_ciu_to_irq) ||
> +	if (line >= ARRAY_SIZE(octeon_irq_ciu_to_irq) ||
>   		octeon_irq_ciu_to_irq[line][bit] != 0)
>   		return -EINVAL;
>
>

  reply	other threads:[~2016-07-14 15:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-14 10:14 [patch] MIPS: OCTEON: Off by one in octeon_irq_gpio_map() Dan Carpenter
2016-07-14 10:14 ` Dan Carpenter
2016-07-14 15:38 ` David Daney [this message]
2016-07-14 15:38   ` David Daney

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=5787B206.3030902@gmail.com \
    --to=ddaney.cavm@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=david.daney@cavium.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=marc.zyngier@arm.com \
    --cc=ralf@linux-mips.org \
    --cc=robh@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 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.