Date:2011-01-09 20:55:36 (13 years 2 months ago)
Author:Maarten ter Huurne
Commit:9c70070ba42528526a1f04d3f3b1b218469df065
Message:mtd: nand: Fixed null pointer dereference.

The "bd" argument of verify_bbt_descr() was dereferenced before it was checked for NULL.
Files: drivers/mtd/nand/nand_bbt.c (1 diff)

Change Details

drivers/mtd/nand/nand_bbt.c
11001100static void verify_bbt_descr(struct mtd_info *mtd, struct nand_bbt_descr *bd)
11011101{
11021102    struct nand_chip *this = mtd->priv;
1103    u32 pattern_len = bd->len;
1104    u32 bits = bd->options & NAND_BBT_NRBITS_MSK;
1105    u32 table_size;
1103    u32 pattern_len, bits, table_size;
11061104
11071105    if (!bd)
11081106        return;
1107
1108    pattern_len = bd->len;
1109    bits = bd->options & NAND_BBT_NRBITS_MSK;
1110
11091111    BUG_ON((this->options & NAND_USE_FLASH_BBT_NO_OOB) &&
11101112            !(this->options & NAND_USE_FLASH_BBT));
11111113    BUG_ON(!bits);

Archive Download the corresponding diff file



interactive