]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: core: don't remove debugfs directory if device is in use
authorZev Weiss <zev@bewilderbeest.net>
Thu, 14 Oct 2021 20:39:52 +0000 (13:39 -0700)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Fri, 15 Oct 2021 10:30:40 +0000 (12:30 +0200)
commita3c45386a24c39a25b840b39d017a95cdecf9b0a
tree5cb53144b70018a704b03c28b15d60ed3d3d883d
parenta5eea05aeccc2f605c8033f202829c8b569d40b3
mtd: core: don't remove debugfs directory if device is in use

Previously, if del_mtd_device() failed with -EBUSY due to a non-zero
usecount, a subsequent call to attempt the deletion again would try to
remove a debugfs directory that had already been removed and panic.
With this change the second call can instead proceed safely.

Fixes: b647c8142024 ("mtd: create per-device and module-scope debugfs entries")
Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20211014203953.5424-1-zev@bewilderbeest.net
drivers/mtd/mtdcore.c