mtd: rawnand: Fix a memory leak bug
authorWenwen Wang <wenwen@cs.uga.edu>
Mon, 19 Aug 2019 02:46:04 +0000 (21:46 -0500)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Sat, 24 Aug 2019 11:13:41 +0000 (13:13 +0200)
commit86aa04f4c2215912fcca6728f2dcf174f7e31fc4
tree83e2bf4ce79b3006cc722ae76ccc0ba57a9f6c43
parentd83aef09aaa50bdafbb32981859128299abf32eb
mtd: rawnand: Fix a memory leak bug

In nand_scan_bbt(), a temporary buffer 'buf' is allocated through
vmalloc(). However, if check_create() fails, 'buf' is not deallocated,
leading to a memory leak bug. To fix this issue, free 'buf' before
returning the error.

Signed-off-by: Wenwen Wang <wenwen@cs.uga.edu>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/nand/raw/nand_bbt.c