Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 24472ab7 authored by Richard Weinberger's avatar Richard Weinberger Committed by Tatyana Brokhman
Browse files

UBI: Add some asserts to ubi_attach_fastmap()



Add more paranioa asserts to make it easier to detect
implementation errors.

Change-Id: I4493648f5a019bbec5d0046074be5b9f6abdcf59
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Git-commit: ae0d146955665411a6d4cea5e0893429cfc52807
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git


Signed-off-by: default avatarTatyana Brokhman <tlinder@codeaurora.org>
parent 32cba237
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -826,6 +826,10 @@ static int ubi_attach_fastmap(struct ubi_device *ubi,
	list_for_each_entry_safe(tmp_aeb, _tmp_aeb, &free, u.list)
		list_move_tail(&tmp_aeb->u.list, &ai->free);

	ubi_assert(list_empty(&used));
	ubi_assert(list_empty(&eba_orphans));
	ubi_assert(list_empty(&free));

	/*
	 * If fastmap is leaking PEBs (must not happen), raise a
	 * fat warning and fall back to scanning mode.