aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2014-10-24 09:22:05 -0400
committerRichard Weinberger <richard@nod.at>2015-03-26 17:46:00 -0400
commitad3d6a05ee45eebf68ff08da0d3f86251b530a27 (patch)
tree6b56464c8b10233c0e70b30e8cfe1c371e62fad6
parent68e3226bd4e05c4be1f6286e4e708e1163ffa092 (diff)
UBI: Fastmap: Fix leb_count unbalance
If a LEB is unmapped we have to decrement leb_count as well. Signed-off-by: Richard Weinberger <richard@nod.at>
-rw-r--r--drivers/mtd/ubi/fastmap.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/mtd/ubi/fastmap.c b/drivers/mtd/ubi/fastmap.c
index 3d913f53fd06..5db41a5fdd7a 100644
--- a/drivers/mtd/ubi/fastmap.c
+++ b/drivers/mtd/ubi/fastmap.c
@@ -362,6 +362,7 @@ static void unmap_peb(struct ubi_attach_info *ai, int pnum)
362 aeb = rb_entry(node2, struct ubi_ainf_peb, u.rb); 362 aeb = rb_entry(node2, struct ubi_ainf_peb, u.rb);
363 if (aeb->pnum == pnum) { 363 if (aeb->pnum == pnum) {
364 rb_erase(&aeb->u.rb, &av->root); 364 rb_erase(&aeb->u.rb, &av->root);
365 av->leb_count--;
365 kmem_cache_free(ai->aeb_slab_cache, aeb); 366 kmem_cache_free(ai->aeb_slab_cache, aeb);
366 return; 367 return;
367 } 368 }