public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] mtd/mxc_nand: fix read past buffer end
@ 2011-03-02 14:47 Baruch Siach
  2011-03-02 15:02 ` Sascha Hauer
  2011-03-07  9:29 ` Artem Bityutskiy
  0 siblings, 2 replies; 4+ messages in thread
From: Baruch Siach @ 2011-03-02 14:47 UTC (permalink / raw)
  To: linux-mtd; +Cc: Baruch Siach, Sascha Hauer

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
 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 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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-03-07  9:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2011-03-07  9:29 ` Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox