From: Baruch Siach Date: Wed, 2 Mar 2011 14:47:55 +0000 (+0200) Subject: mtd: mxc_nand: fix read past buffer end X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=5d9d9936209e589569a97985285b3282310cf2db;p=linux-beck.git mtd: mxc_nand: fix read past buffer end Signed-off-by: Baruch Siach Acked-by: Sascha hauer Signed-off-by: David Woodhouse --- diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c index ef932ba55a0b..6cd78ed439a7 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