Skip to content

Commit 72f3d3d

Browse files
bwh-mindrichardweinberger
authored andcommitted
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: 927c145 ("mtd: ubi: attach from device tree") Signed-off-by: Richard Weinberger <richard@nod.at>
1 parent 06776df commit 72f3d3d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/mtd/ubi/build.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1372,7 +1372,7 @@ static int __init ubi_init(void)
13721372

13731373
/* See comment above re-ubi_is_module(). */
13741374
if (ubi_is_module())
1375-
goto out_slab;
1375+
goto out_debugfs;
13761376
}
13771377

13781378
register_mtd_user(&ubi_mtd_notifier);
@@ -1387,6 +1387,9 @@ static int __init ubi_init(void)
13871387

13881388
out_mtd_notifier:
13891389
unregister_mtd_user(&ubi_mtd_notifier);
1390+
ubiblock_exit();
1391+
out_debugfs:
1392+
ubi_debugfs_exit();
13901393
out_slab:
13911394
kmem_cache_destroy(ubi_wl_entry_slab);
13921395
out_dev_unreg:

0 commit comments

Comments
 (0)