am 5d6309e7: fix comparison of ECC stats before and after mtd reads

* commit '5d6309e77f6055a9aec062dd991d071054726ebb':
  fix comparison of ECC stats before and after mtd reads
diff --git a/mtdutils/mtdutils.c b/mtdutils/mtdutils.c
index 48d5ea9..198f498 100644
--- a/mtdutils/mtdutils.c
+++ b/mtdutils/mtdutils.c
@@ -309,6 +309,8 @@
             fprintf(stderr, "mtd: ECC errors (%d soft, %d hard) at 0x%08llx\n",
                     after.corrected - before.corrected,
                     after.failed - before.failed, pos);
+            // copy the comparison baseline for the next read.
+            memcpy(&before, &after, sizeof(struct mtd_ecc_stats));
         } else if ((mgbb = ioctl(fd, MEMGETBADBLOCK, &pos))) {
             fprintf(stderr,
                     "mtd: MEMGETBADBLOCK returned %d at 0x%08llx (errno=%d)\n",