提交 b974696d 编写于 作者: U Uwe Kleine-König 提交者: Brian Norris

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: 5346c27c ("mtd: nandsim: Introduce debugfs infrastructure")
Signed-off-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: NRichard Weinberger <richard@nod.at>
Acked-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
上级 9a515447
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册