9
0
Fork 0

UBI: Add some asserts to ubi_attach_fastmap()

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

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Richard Weinberger 2013-09-28 15:55:16 +02:00 committed by Sascha Hauer
parent 71791bd2cb
commit 73618394bf
1 changed files with 4 additions and 0 deletions

View File

@ -815,6 +815,10 @@ static int ubi_attach_fastmap(struct ubi_device *ubi,
list_for_each_entry_safe(tmp_aeb, _tmp_aeb, &lfree, 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(&lfree));
/*
* If fastmap is leaking PEBs (must not happen), raise a
* fat warning and fall back to scanning mode.