From patchwork Mon Oct 11 09:19:38 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: nanddump: fix initialization of bad blocks oob data buffer Date: Sun, 10 Oct 2010 23:19:38 -0000 From: Baruch Siach X-Patchwork-Id: 67398 Message-Id: <0870ac8ab250ec91dceb2cc461fe82c0d7995bc8.1286788714.git.baruch@tkos.co.il> To: linux-mtd@lists.infradead.org Cc: Baruch Siach When dumping oob data of a bad block, initialize oobbuf with 0xff, instead of readbuf. This avoids bogus oob data on output. Signed-off-by: Baruch Siach Acked-by: Mike Frysinger --- nanddump.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/nanddump.c b/nanddump.c index 3589931..0fdf736 100644 --- a/nanddump.c +++ b/nanddump.c @@ -452,7 +452,7 @@ int main(int argc, char * const argv[]) continue; if (badblock) { - memset (readbuf, 0xff, meminfo.oobsize); + memset (oobbuf, 0xff, meminfo.oobsize); } else { /* Read OOB data and exit on failure */ oob.start = ofs;