Patchwork mtd: tests/read: initialize buffer for whole next page

login
register
mail settings
Submitter Christian Herzig
Date Nov. 23, 2012, 2:31 p.m.
Message ID <1353681086-9877-1-git-send-email-christian.herzig@keymile.com>
Download mbox | patch
Permalink /patch/201334/
State Accepted
Commit d8b1e34e248d89f43bab18704894d537dc0b497e
Headers show

Comments

Christian Herzig - Nov. 23, 2012, 2:31 p.m.
fix: do block-buffer initialize for the whole next page to zero.

Signed-off-by: Christian Herzig <christian.herzig@keymile.com>
---
 drivers/mtd/tests/mtd_readtest.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/drivers/mtd/tests/mtd_readtest.c b/drivers/mtd/tests/mtd_readtest.c
index 121aba1..fbb74cb 100644
--- a/drivers/mtd/tests/mtd_readtest.c
+++ b/drivers/mtd/tests/mtd_readtest.c
@@ -51,7 +51,7 @@  static int read_eraseblock_by_page(int ebnum)
 	void *oobbuf = iobuf1;
 
 	for (i = 0; i < pgcnt; i++) {
-		memset(buf, 0 , pgcnt);
+		memset(buf, 0 , pgsize);
 		ret = mtd_read(mtd, addr, pgsize, &read, buf);
 		if (ret == -EUCLEAN)
 			ret = 0;