From: Konstantin Baydarov <kbaidarov@dev.rtsoft.ru>
To: linux-mtd@lists.infradead.org
Subject: [PATCH] [MTD] NAND: Initialization of Bad Block Pattern
Date: Wed, 22 Nov 2006 17:28:05 +0300 [thread overview]
Message-ID: <20061122172805.7126391f@localhost.localdomain> (raw)
Second try. This patch correctly initialize badblock_pattern in
case NAND_IS_AND. Currently badblock_pattern is uninitialized and
if someone try to use it NULL pointer dereference will happen.
Signed-off-by: Konstantin Baydarov <kbaidarov@dev.rtsoft.ru>
Index: linux-2.6.18/drivers/mtd/nand/nand_bbt.c
===================================================================
--- linux-2.6.18.orig/drivers/mtd/nand/nand_bbt.c
+++ linux-2.6.18/drivers/mtd/nand/nand_bbt.c
@@ -1165,7 +1165,8 @@ int nand_default_bbt(struct mtd_info *mt
this->bbt_md = &bbt_mirror_descr;
}
this->options |= NAND_USE_FLASH_BBT;
- return nand_scan_bbt(mtd, &agand_flashbased);
+ this->badblock_pattern = &agand_flashbased;
+ return nand_scan_bbt(mtd, this->badblock_pattern);
}
/* Is a flash based bad block table requested ? */
reply other threads:[~2006-11-22 14:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061122172805.7126391f@localhost.localdomain \
--to=kbaidarov@dev.rtsoft.ru \
--cc=linux-mtd@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox