mirror of
https://github.com/torvalds/linux.git
synced 2026-04-25 10:02:31 -04:00
[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>
This commit is contained in:
committed by
Kyungmin Park
parent
75384b0d9c
commit
f00b0046d2
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user