summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/nand_bbt.c
diff options
context:
space:
mode:
authorBrian Norris <computersforpeace@gmail.com>2014-05-21 07:34:40 +0200
committerBrian Norris <computersforpeace@gmail.com>2014-05-28 09:05:25 +0200
commitabb9cf78e80ab4407c3efb0950f08e6941bc7e73 (patch)
treeec9f415a3fac3c89772590a390f213239c40e7cf /drivers/mtd/nand/nand_bbt.c
parentmtd: nand_bbt: remove unused variable (diff)
downloadlinux-abb9cf78e80ab4407c3efb0950f08e6941bc7e73.tar.xz
linux-abb9cf78e80ab4407c3efb0950f08e6941bc7e73.zip
mtd: nand_bbt: handle error case for nand_create_badblock_pattern()
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'drivers/mtd/nand/nand_bbt.c')
-rw-r--r--drivers/mtd/nand/nand_bbt.c8
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)
int nand_default_bbt(struct mtd_info *mtd)
{
struct nand_chip *this = mtd->priv;
+ int ret;
/* Is a flash based bad block table requested? */
if (this->bbt_options & NAND_BBT_USE_FLASH) {
@@ -1300,8 +1301,11 @@ int nand_default_bbt(struct mtd_info *mtd)
this->bbt_md = NULL;
}
- if (!this->badblock_pattern)
- nand_create_badblock_pattern(this);
+ if (!this->badblock_pattern) {
+ ret = nand_create_badblock_pattern(this);
+ if (ret)
+ return ret;
+ }
return nand_scan_bbt(mtd, this->badblock_pattern);
}