Skip to content

Commit

Permalink
UBI: Add some asserts to ubi_attach_fastmap()
Browse files Browse the repository at this point in the history
Add more paranioa asserts to make it easier to detect
implementation errors.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
  • Loading branch information
Richard Weinberger authored and Artem Bityutskiy committed Oct 3, 2013
1 parent fe24c6e commit ae0d146
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/mtd/ubi/fastmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit ae0d146

Please sign in to comment.