Re: [PATCH] mtd: onenand_base: Fix a memory leak bug

2019-08-26 Thread Miquel Raynal
On Sun, 2019-08-18 at 15:52:49 UTC, Wenwen Wang wrote: > 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

[PATCH] mtd: onenand_base: Fix a memory leak bug

2019-08-18 Thread Wenwen Wang
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'