diff options
author | Brian Norris <computersforpeace@gmail.com> | 2014-05-21 01:34:40 -0400 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2014-05-28 03:05:25 -0400 |
commit | abb9cf78e80ab4407c3efb0950f08e6941bc7e73 (patch) | |
tree | ec9f415a3fac3c89772590a390f213239c40e7cf /drivers/mtd | |
parent | 930de53701c139fd55c7f576b7da055dbb8aabdc (diff) |
mtd: nand_bbt: handle error case for nand_create_badblock_pattern()
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/nand/nand_bbt.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/mtd/nand/nand_bbt.c b/drivers/mtd/nand/nand_bbt.c index 6cbf8768a0a4..7f0c3b4c2a4f 100644 --- a/drivers/mtd/nand/nand_bbt.c +++ b/drivers/mtd/nand/nand_bbt.c | |||
@@ -1282,6 +1282,7 @@ static int nand_create_badblock_pattern(struct nand_chip *this) | |||
1282 | int nand_default_bbt(struct mtd_info *mtd) | 1282 | int nand_default_bbt(struct mtd_info *mtd) |
1283 | { | 1283 | { |
1284 | struct nand_chip *this = mtd->priv; | 1284 | struct nand_chip *this = mtd->priv; |
1285 | int ret; | ||
1285 | 1286 | ||
1286 | /* Is a flash based bad block table requested? */ | 1287 | /* Is a flash based bad block table requested? */ |
1287 | if (this->bbt_options & NAND_BBT_USE_FLASH) { | 1288 | if (this->bbt_options & NAND_BBT_USE_FLASH) { |
@@ -1300,8 +1301,11 @@ int nand_default_bbt(struct mtd_info *mtd) | |||
1300 | this->bbt_md = NULL; | 1301 | this->bbt_md = NULL; |
1301 | } | 1302 | } |
1302 | 1303 | ||
1303 | if (!this->badblock_pattern) | 1304 | if (!this->badblock_pattern) { |
1304 | nand_create_badblock_pattern(this); | 1305 | ret = nand_create_badblock_pattern(this); |
1306 | if (ret) | ||
1307 | return ret; | ||
1308 | } | ||
1305 | 1309 | ||
1306 | return nand_scan_bbt(mtd, this->badblock_pattern); | 1310 | return nand_scan_bbt(mtd, this->badblock_pattern); |
1307 | } | 1311 | } |