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

login
register
mail settings
Submitter Richard Weinberger
Date June 1, 2012, 3:16 p.m.
Message ID <1338563804-85990-18-git-send-email-richard@nod.at>
Download mbox | patch
Permalink /patch/162341/
State New
Headers show

Comments

Richard Weinberger - June 1, 2012, 3:16 p.m.
Ensure that this corner case is valid.

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

Patch

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;