From patchwork Mon Oct 11 09:19:38 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baruch Siach X-Patchwork-Id: 67398 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from canuck.infradead.org (canuck.infradead.org [134.117.69.58]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 14119B70A7 for ; Mon, 11 Oct 2010 20:27:48 +1100 (EST) Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1P5EYT-0004Nc-JX; Mon, 11 Oct 2010 09:20:25 +0000 Received: from tango.tkos.co.il ([62.219.50.35]) by canuck.infradead.org with esmtps (Exim 4.72 #1 (Red Hat Linux)) id 1P5EYI-0004Lp-1Y for linux-mtd@lists.infradead.org; Mon, 11 Oct 2010 09:20:16 +0000 Received: from jasper.tkos.co.il (89-139-40-191.bb.netvision.net.il [89.139.40.191]) (authenticated bits=0) by tango.tkos.co.il (8.14.4/8.12.11) with ESMTP id o9B9K27S031877; Mon, 11 Oct 2010 11:20:06 +0200 From: Baruch Siach To: linux-mtd@lists.infradead.org Subject: [PATCH] nanddump: fix initialization of bad blocks oob data buffer Date: Mon, 11 Oct 2010 11:19:38 +0200 Message-Id: <0870ac8ab250ec91dceb2cc461fe82c0d7995bc8.1286788714.git.baruch@tkos.co.il> X-Mailer: git-send-email 1.7.1 X-Spam-Level: -2.212 () BAYES_00,RDNS_DYNAMIC X-Scanned-By: MIMEDefang 2.62 on 62.219.50.35 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20101011_052014_493741_07E66489 X-CRM114-Status: UNSURE ( 8.70 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain Cc: Baruch Siach X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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;