[PATCH 17/23] UBI: Fastmap: Add ubi_assert()

Richard Weinberger richard at nod.at
Fri Jun 1 11:16:38 EDT 2012


Ensure that this corner case is valid.

Signed-off-by: Richard Weinberger <richard at nod.at>
---
 drivers/mtd/ubi/fastmap.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/ubi/fastmap.c b/drivers/mtd/ubi/fastmap.c
index 85474a8..a0919ec 100644
--- a/drivers/mtd/ubi/fastmap.c
+++ b/drivers/mtd/ubi/fastmap.c
@@ -195,6 +195,7 @@ static int update_vol(struct ubi_device *ubi, struct ubi_attach_info *ai,
 		 * Then a PEB can be within the persistent EBA and the pool.
 		 */
 		if (aeb->pnum == new_aeb->pnum) {
+			ubi_assert(aeb->lnum == new_aeb->lnum);
 			kmem_cache_free(ai->aeb_slab_cache, new_aeb);
 
 			return 0;
-- 
1.7.6.5




More information about the linux-mtd mailing list