aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--miscutils/nandwrite.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/miscutils/nandwrite.c b/miscutils/nandwrite.c
index e3f9b565d..8c4da802f 100644
--- a/miscutils/nandwrite.c
+++ b/miscutils/nandwrite.c
@@ -64,8 +64,8 @@ static void dump_bad(struct mtd_info_user *meminfo, unsigned len, int oob)
64 unsigned char buf[meminfo->writesize]; 64 unsigned char buf[meminfo->writesize];
65 unsigned count; 65 unsigned count;
66 66
67 /* round len to the next page */ 67 /* round len to the next page only if len is not already on a page */
68 len = (len | ~(meminfo->writesize - 1)) + 1; 68 len = ((len - 1) | (meminfo->writesize - 1)) + 1;
69 69
70 memset(buf, 0xff, sizeof(buf)); 70 memset(buf, 0xff, sizeof(buf));
71 for (count = 0; count < len; count += meminfo->writesize) { 71 for (count = 0; count < len; count += meminfo->writesize) {