summaryrefslogtreecommitdiff
path: root/drivers/mtd
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2013-09-28 15:55:16 +0200
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2013-10-03 19:42:51 +0300
commitae0d146955665411a6d4cea5e0893429cfc52807 (patch)
tree177d30ac3bc4a5b8aa751b97e722f8150a6259c7 /drivers/mtd
parentfe24c6e5f51ec5ea42d432f67618a084047a23ed (diff)
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: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/ubi/fastmap.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/mtd/ubi/fastmap.c b/drivers/mtd/ubi/fastmap.c
index 4cfc8da27221..ead861307b3c 100644
--- a/drivers/mtd/ubi/fastmap.c
+++ b/drivers/mtd/ubi/fastmap.c
@@ -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.