linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Li Yang <leoli@freescale.com>
To: Roel Kluin <roel.kluin@gmail.com>
Cc: linuxppc-dev@ozlabs.org, lkml <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] freescale: beyond ARRAY_SIZE of fdev->chan
Date: Fri, 22 May 2009 16:03:26 +0800	[thread overview]
Message-ID: <2a27d3730905220103k12d7f9a6n269fcd079818b168@mail.gmail.com> (raw)
In-Reply-To: <4A133DEF.6080604@gmail.com>

On Wed, May 20, 2009 at 7:17 AM, Roel Kluin <roel.kluin@gmail.com> wrote:
> Do not go beyond ARRAY_SIZE of fdev->chan
>
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>

Indeed, thanks.

But I would like the title and description of this patch be changed to
like this:

fsldma: fix check on potential fdev->chan[] overflow

Fix the check of potential array overflow when using corrupted channel
device tree nodes.

> ---
> diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c
> index da8a8ed..391b1bd 100644
> --- a/drivers/dma/fsldma.c
> +++ b/drivers/dma/fsldma.c
> @@ -830,7 +830,7 @@ static int __devinit fsl_dma_chan_probe(struct fsl_dma_device *fdev,
>                        new_fsl_chan->reg.end - new_fsl_chan->reg.start + 1);
>
>        new_fsl_chan->id = ((new_fsl_chan->reg.start - 0x100) & 0xfff) >> 7;
> -       if (new_fsl_chan->id > FSL_DMA_MAX_CHANS_PER_DEVICE) {
> +       if (new_fsl_chan->id >= FSL_DMA_MAX_CHANS_PER_DEVICE) {
>                dev_err(fdev->dev, "There is no %d channel!\n",
>                                new_fsl_chan->id);
>                err = -EINVAL;

      reply	other threads:[~2009-05-22  8:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-19 23:17 [PATCH] freescale: beyond ARRAY_SIZE of fdev->chan Roel Kluin
2009-05-22  8:03 ` Li Yang [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=2a27d3730905220103k12d7f9a6n269fcd079818b168@mail.gmail.com \
    --to=leoli@freescale.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=roel.kluin@gmail.com \
    /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).