Skip to content

Commit

Permalink
mtd: nandsim: remove debugfs entries in error path
Browse files Browse the repository at this point in the history
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: 5346c27 ("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>
  • Loading branch information
Uwe Kleine-König authored and Brian Norris committed Aug 25, 2017
1 parent 9a51544 commit b974696
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/mtd/nand/nandsim.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b974696

Please sign in to comment.