summaryrefslogtreecommitdiff
path: root/drivers/mtd
diff options
context:
space:
mode:
authorMiquel Raynal <miquel.raynal@bootlin.com>2020-05-25 10:58:47 +0200
committerMiquel Raynal <miquel.raynal@bootlin.com>2020-05-31 10:53:38 +0200
commit5dcb5164b20eaa178dcea9572c8b0dccabef7a25 (patch)
tree9e64a402aa8e68cafc5ef830b44cff9bb89ebbfe /drivers/mtd
parent82503f8412dfbcaf03e8a72663d2a416131f0113 (diff)
mtd: rawnand: nandsim: Free erase_block_wear on error
Free erase_block_wear on error, which is allocated by ns_setup_wear_reporting(). Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20200525085851.17682-14-miquel.raynal@bootlin.com
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/raw/nandsim.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mtd/nand/raw/nandsim.c b/drivers/mtd/nand/raw/nandsim.c
index a31a8aaab1fe..8511e70ca1e9 100644
--- a/drivers/mtd/nand/raw/nandsim.c
+++ b/drivers/mtd/nand/raw/nandsim.c
@@ -2383,7 +2383,7 @@ static int __init ns_init_module(void)
ret = ns_init(nsmtd);
if (ret)
- goto err_exit;
+ goto free_ebw;
ret = nand_create_bbt(chip);
if (ret)
@@ -2409,6 +2409,8 @@ unregister_mtd:
err_exit:
free_ns_object:
ns_free(ns);
+free_ebw:
+ kfree(erase_block_wear);
nand_cleanup(chip);
error:
kfree(ns);