mtd: tests/read: initialize buffer for whole next page
authorChristian Herzig <christian.herzig@keymile.com>
Fri, 23 Nov 2012 14:31:26 +0000 (15:31 +0100)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Tue, 4 Dec 2012 14:00:34 +0000 (16:00 +0200)
fix: do block-buffer initialize for the whole next page to zero.

Signed-off-by: Christian Herzig <christian.herzig@keymile.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
drivers/mtd/tests/mtd_readtest.c

index 31f505cc942a326f34da3c747d0bcf842652e134..266de04b6d29ef1666ab54ea05250411536ed0ef 100644 (file)
@@ -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;