public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Baruch Siach <baruch@tkos.co.il>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: linux-mtd@lists.infradead.org, Sascha Hauer <kernel@pengutronix.de>
Subject: Re: [PATCH] mtd/mxc_nand: fix read past buffer end
Date: Wed, 2 Mar 2011 17:06:50 +0200	[thread overview]
Message-ID: <20110302150650.GE28548@jasper.tkos.co.il> (raw)
In-Reply-To: <20110302150235.GC29521@pengutronix.de>

Hi Sascha,

On Wed, Mar 02, 2011 at 04:02:35PM +0100, Sascha Hauer wrote:
> On Wed, Mar 02, 2011 at 04:47:55PM +0200, Baruch Siach wrote:
> > Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> > ---
> >  drivers/mtd/nand/mxc_nand.c |    4 ++--
> >  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> Looks good to me. Did you stumble upon this by accident or did something
> break? If yes, would be good to have it in the commit log.

I found it by looking at the code. This doesn't fix my actual problem (wrong 
oob read and/or write with flash of page size 4K+218).

> Otherwise:
> 
> Acked-by: Sascha hauer <s.hauer@pengutronix.de>

Thanks,
baruch

> > diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
> > index 7b33811..466d7a9 100644
> > --- a/drivers/mtd/nand/mxc_nand.c
> > +++ b/drivers/mtd/nand/mxc_nand.c
> > @@ -641,9 +641,9 @@ static void mxc_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len)
> >  
> >  	n = min(n, len);
> >  
> > -	memcpy(buf, host->data_buf + col, len);
> > +	memcpy(buf, host->data_buf + col, n);
> >  
> > -	host->buf_start += len;
> > +	host->buf_start += n;
> >  }
> >  
> >  /* Used by the upper layer to verify the data in NAND Flash
> > -- 
> > 1.7.2.3

-- 
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch@tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -

  reply	other threads:[~2011-03-02 15:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-02 14:47 [PATCH] mtd/mxc_nand: fix read past buffer end Baruch Siach
2011-03-02 15:02 ` Sascha Hauer
2011-03-02 15:06   ` Baruch Siach [this message]
2011-03-07  9:29 ` Artem Bityutskiy

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=20110302150650.GE28548@jasper.tkos.co.il \
    --to=baruch@tkos.co.il \
    --cc=kernel@pengutronix.de \
    --cc=linux-mtd@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /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