diff options
Diffstat (limited to 'drivers/mtd/onenand')
-rw-r--r-- | drivers/mtd/onenand/onenand_base.c | 5 | ||||
-rw-r--r-- | drivers/mtd/onenand/onenand_bbt.c | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c index 0ade23749ee1..0249b4aa0976 100644 --- a/drivers/mtd/onenand/onenand_base.c +++ b/drivers/mtd/onenand/onenand_base.c | |||
@@ -2133,8 +2133,11 @@ void onenand_release(struct mtd_info *mtd) | |||
2133 | del_mtd_device (mtd); | 2133 | del_mtd_device (mtd); |
2134 | 2134 | ||
2135 | /* Free bad block table memory, if allocated */ | 2135 | /* Free bad block table memory, if allocated */ |
2136 | if (this->bbm) | 2136 | if (this->bbm) { |
2137 | struct bbm_info *bbm = this->bbm; | ||
2138 | kfree(bbm->bbt); | ||
2137 | kfree(this->bbm); | 2139 | kfree(this->bbm); |
2140 | } | ||
2138 | /* Buffer allocated by onenand_scan */ | 2141 | /* Buffer allocated by onenand_scan */ |
2139 | if (this->options & ONENAND_PAGEBUF_ALLOC) | 2142 | if (this->options & ONENAND_PAGEBUF_ALLOC) |
2140 | kfree(this->page_buf); | 2143 | kfree(this->page_buf); |
diff --git a/drivers/mtd/onenand/onenand_bbt.c b/drivers/mtd/onenand/onenand_bbt.c index 98f8fd1c6375..90db8f5b1f84 100644 --- a/drivers/mtd/onenand/onenand_bbt.c +++ b/drivers/mtd/onenand/onenand_bbt.c | |||
@@ -168,8 +168,8 @@ static int onenand_isbad_bbt(struct mtd_info *mtd, loff_t offs, int allowbbt) | |||
168 | * marked good / bad blocks and writes the bad block table(s) to | 168 | * marked good / bad blocks and writes the bad block table(s) to |
169 | * the selected place. | 169 | * the selected place. |
170 | * | 170 | * |
171 | * The bad block table memory is allocated here. It must be freed | 171 | * The bad block table memory is allocated here. It is freed |
172 | * by calling the onenand_free_bbt function. | 172 | * by the onenand_release function. |
173 | * | 173 | * |
174 | */ | 174 | */ |
175 | int onenand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd) | 175 | int onenand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd) |