mtd: mxc_nand: fix read past buffer end

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Mar 11 10:59:06 EST 2011


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=5d9d9936209e589569a97985285b3282310cf2db
Commit:     5d9d9936209e589569a97985285b3282310cf2db
Parent:     74f1b7244e502c5a98906a5dcc5ec389aacd25e6
Author:     Baruch Siach <baruch at tkos.co.il>
AuthorDate: Wed Mar 2 16:47:55 2011 +0200
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Fri Mar 11 14:22:49 2011 +0000

    mtd: mxc_nand: fix read past buffer end
    
    Signed-off-by: Baruch Siach <baruch at tkos.co.il>
    Acked-by: Sascha hauer <s.hauer at pengutronix.de>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/nand/mxc_nand.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index ef932ba..6cd78ed 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



More information about the linux-mtd-cvs mailing list