Commit 72f3d3da authored by Ben Hutchings's avatar Ben Hutchings Committed by Richard Weinberger
Browse files

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: default avatarBen Hutchings <ben.hutchings@mind.be>
Fixes: 927c1452 ("mtd: ubi: attach from device tree")
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
parent 06776df7
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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: