diff options
author | Adrian Hunter <[ext-adrian.hunter@nokia.com]> | 2007-01-22 17:01:01 +0900 |
---|---|---|
committer | Kyungmin Park <kyungmin.park@samsung.com> | 2007-01-22 21:27:56 +0900 |
commit | f00b0046d2eafac3e78e8def9374c7492820a9d2 (patch) | |
tree | ddcbbacccff7f64fdac41cdfe91a07b6aca20aca /drivers/mtd/onenand/onenand_base.c | |
parent | 75384b0d9c04dc2d48f45825f84a982eaf5c2f53 (diff) |
[MTD] OneNAND: Free the bad block table when the device is released
OneNAND does 2 memory allocations for bad block information.
Only one of them was being freed.
Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Diffstat (limited to 'drivers/mtd/onenand/onenand_base.c')
-rw-r--r-- | drivers/mtd/onenand/onenand_base.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c index 0ade23749ee..0249b4aa097 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) del_mtd_device (mtd); /* Free bad block table memory, if allocated */ - if (this->bbm) + if (this->bbm) { + struct bbm_info *bbm = this->bbm; + kfree(bbm->bbt); kfree(this->bbm); + } /* Buffer allocated by onenand_scan */ if (this->options & ONENAND_PAGEBUF_ALLOC) kfree(this->page_buf); |