summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2017-08-23 09:03:04 +0200
committerBrian Norris <computersforpeace@gmail.com>2017-08-25 05:59:43 +0200
commitb974696da1cfc5aa0c29ed97dc8f6c239899e64b (patch)
tree264b840fb18b79f50c5d21bf6f44ee5880a8dad3
parentmtd: blkdevs: Fix mtd block write failure (diff)
downloadlinux-b974696da1cfc5aa0c29ed97dc8f6c239899e64b.tar.xz
linux-b974696da1cfc5aa0c29ed97dc8f6c239899e64b.zip
mtd: nandsim: remove debugfs entries in error path
The debugfs entries must be removed before an error is returned in the probe function. Otherwise another try to load the module fails and when the debugfs files are accessed without the module loaded, the kernel still tries to call a function in that module. Fixes: 5346c27c5fed ("mtd: nandsim: Introduce debugfs infrastructure") Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Richard Weinberger <richard@nod.at> Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
-rw-r--r--drivers/mtd/nand/nandsim.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c
index 03a0d057bf2f..e4211c3cc49b 100644
--- a/drivers/mtd/nand/nandsim.c
+++ b/drivers/mtd/nand/nandsim.c
@@ -2373,6 +2373,7 @@ static int __init ns_init_module(void)
return 0;
err_exit:
+ nandsim_debugfs_remove(nand);
free_nandsim(nand);
nand_release(nsmtd);
for (i = 0;i < ARRAY_SIZE(nand->partitions); ++i)