summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/raw/nandsim.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/mtd/nand/raw/nandsim.c b/drivers/mtd/nand/raw/nandsim.c
index 4bc5da3be587..127ba2081fe9 100644
--- a/drivers/mtd/nand/raw/nandsim.c
+++ b/drivers/mtd/nand/raw/nandsim.c
@@ -2400,13 +2400,15 @@ static int __init ns_init_module(void)
ret = ns_debugfs_create(ns);
if (ret)
- goto err_exit;
+ goto unregister_mtd;
return 0;
+unregister_mtd:
+ WARN_ON(mtd_device_unregister(nsmtd));
err_exit:
ns_free(ns);
- nand_release(chip);
+ nand_cleanup(chip);
error:
kfree(ns);
ns_free_lists();