Skip to content
Commit d83aef09 authored by Wenwen Wang's avatar Wenwen Wang Committed by Miquel Raynal
Browse files

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: default avatarWenwen Wang <wenwen@cs.uga.edu>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
parent 80107e76
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment