mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-24 17:59:32 +00:00
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: 5346c27c5f
("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>
This commit is contained in:
parent
9a51544774
commit
b974696da1
1 changed files with 1 additions and 0 deletions
|
@ -2373,6 +2373,7 @@ static int __init ns_init_module(void)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
err_exit:
|
err_exit:
|
||||||
|
nandsim_debugfs_remove(nand);
|
||||||
free_nandsim(nand);
|
free_nandsim(nand);
|
||||||
nand_release(nsmtd);
|
nand_release(nsmtd);
|
||||||
for (i = 0;i < ARRAY_SIZE(nand->partitions); ++i)
|
for (i = 0;i < ARRAY_SIZE(nand->partitions); ++i)
|
||||||
|
|
Loading…
Reference in a new issue