Skip to contentSkip to conversation

mtd/nand: move pointer dereferencing after the actual check in verify_bbt_descr

PATCH In review Stanislav Fomichev 2 participants 2 messages Feb 7, 2011 – Feb 11, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd/nand: move pointer dereferencing after the actual check in verify_bbt_descr

---
 drivers/mtd/nand/nand_bbt.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
drivers/mtd/nand/nand_bbt.c +6 -2
index 6ebd869..a1e8b30 100644
@@ -1101,12 +1101,16 @@ static void mark_bbt_region(struct mtd_info *mtd, struct nand_bbt_descr *td)
 static void verify_bbt_descr(struct mtd_info *mtd, struct nand_bbt_descr *bd)
 {
 	struct nand_chip *this = mtd->priv;
-	u32 pattern_len = bd->len;
-	u32 bits = bd->options & NAND_BBT_NRBITS_MSK;
+	u32 pattern_len;
+	u32 bits;
 	u32 table_size;
 
 	if (!bd)
 		return;
+
+	pattern_len = bd->len;
+	bits = bd->options & NAND_BBT_NRBITS_MSK;
+
 	BUG_ON((this->options & NAND_USE_FLASH_BBT_NO_OOB) &&
 			!(this->options & NAND_USE_FLASH_BBT));
 	BUG_ON(!bits);
Signature · 1 line
1.7.1
#1 lore raw

drivers/mtd/nand/nand_bbt.c

Quoted 6 lines · Stanislav Fomichev
---
 drivers/mtd/nand/nand_bbt.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
drivers/mtd/nand/nand_bbt.c +0 -0

Thanks, although the descriptions had a small issue - you put everything to the subject and made it too long. I amended it a little and pushed to l2-mtd-2.6.git tree, thanks.

Signature · 2 lines
Best Regards,
Artem Bityutskiy (Артём Битюцкий)