mtd: nandsim: remove debugfs entries in error path
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Wed, 23 Aug 2017 07:03:04 +0000 (09:03 +0200)
committerBrian Norris <computersforpeace@gmail.com>
Fri, 25 Aug 2017 03:59:43 +0000 (20:59 -0700)
commitb974696da1cfc5aa0c29ed97dc8f6c239899e64b
tree264b840fb18b79f50c5d21bf6f44ee5880a8dad3
parent9a51544774a57fcb94994a61860a17f9e63a8d7b
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>
drivers/mtd/nand/nandsim.c