diff options
author | Ben Hutchings <ben.hutchings@mind.be> | 2024-04-11 00:42:41 +0200 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2024-07-12 21:43:09 +0200 |
commit | 72f3d3daddd740f744a24cd7ef8c27bd0cd5489d (patch) | |
tree | 387defcc5e0de4694b95bb27ce9f8a02eff099a3 /drivers/mtd/ubi | |
parent | 06776df740660e27c351d89f314d05b2720ba41f (diff) |
mtd: ubi: Restore missing cleanup on ubi_init() failure path
We need to clean-up debugfs and ubiblock if we fail after initialising
them.
Signed-off-by: Ben Hutchings <ben.hutchings@mind.be>
Fixes: 927c145208b0 ("mtd: ubi: attach from device tree")
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'drivers/mtd/ubi')
-rw-r--r-- | drivers/mtd/ubi/build.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c index 952c80269f57..30be4ed68fad 100644 --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c @@ -1372,7 +1372,7 @@ static int __init ubi_init(void) /* See comment above re-ubi_is_module(). */ if (ubi_is_module()) - goto out_slab; + goto out_debugfs; } register_mtd_user(&ubi_mtd_notifier); @@ -1387,6 +1387,9 @@ static int __init ubi_init(void) out_mtd_notifier: unregister_mtd_user(&ubi_mtd_notifier); + ubiblock_exit(); +out_debugfs: + ubi_debugfs_exit(); out_slab: kmem_cache_destroy(ubi_wl_entry_slab); out_dev_unreg: |