Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mtd: onenand_base: Fix a memory leak bug
In onenand_scan(), if CONFIG_MTD_ONENAND_VERIFY_WRITE is defined, 'this->verify_buf' is allocated through kzalloc(). However, it is not deallocated in the following execution, if the allocation for 'this->oob_buf' fails, leading to a memory leak bug. To fix this issue, free 'this->verify_buf' before returning the error. Signed-off-by: Wenwen Wang <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
- Loading branch information