public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Baruch Siach <baruch@tkos.co.il>
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 16:02:35 +0100	[thread overview]
Message-ID: <20110302150235.GC29521@pengutronix.de> (raw)
In-Reply-To: <2edd0d1419770540f85178a1f29cd80fccf11e88.1299077237.git.baruch@tkos.co.il>

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.

Otherwise:

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


> 
> 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
> 
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

  reply	other threads:[~2011-03-02 15:02 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 [this message]
2011-03-02 15:06   ` Baruch Siach
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=20110302150235.GC29521@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=baruch@tkos.co.il \
    --cc=kernel@pengutronix.de \
    --cc=linux-mtd@lists.infradead.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