nanddump: skip bad blocks when instructed to do so
authorBaruch Siach <baruch@tkos.co.il>
Mon, 15 Oct 2012 12:25:26 +0000 (14:25 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Mon, 15 Oct 2012 12:25:26 +0000 (14:25 +0200)
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
miscutils/nandwrite.c

index a9343345711383042f6db5a97742d0e3437ab36b..554d362492659bd4ccb2267582263c7e1bd2f740 100644 (file)
@@ -182,7 +182,7 @@ int nandwrite_main(int argc UNUSED_PARAM, char **argv)
                        mtdoffset = next_good_eraseblock(fd, &meminfo, blockstart);
                        if (IS_NANDWRITE)
                                printf("Writing at 0x%08x\n", mtdoffset);
-                       else if (mtdoffset > blockstart) {
+                       else if (mtdoffset > blockstart && !(opts & OPT_b)) {
                                int bad_len = MIN(mtdoffset, limit) - blockstart;
                                dump_bad(&meminfo, bad_len, !(opts & OPT_o));
                        }