Commit 5dcb5164 authored by Miquel Raynal's avatar Miquel Raynal

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: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200525085851.17682-14-miquel.raynal@bootlin.com
parent 82503f84
...@@ -2383,7 +2383,7 @@ static int __init ns_init_module(void) ...@@ -2383,7 +2383,7 @@ static int __init ns_init_module(void)
ret = ns_init(nsmtd); ret = ns_init(nsmtd);
if (ret) if (ret)
goto err_exit; goto free_ebw;
ret = nand_create_bbt(chip); ret = nand_create_bbt(chip);
if (ret) if (ret)
...@@ -2409,6 +2409,8 @@ static int __init ns_init_module(void) ...@@ -2409,6 +2409,8 @@ static int __init ns_init_module(void)
err_exit: err_exit:
free_ns_object: free_ns_object:
ns_free(ns); ns_free(ns);
free_ebw:
kfree(erase_block_wear);
nand_cleanup(chip); nand_cleanup(chip);
error: error:
kfree(ns); kfree(ns);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment