summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2014-10-24 15:22:05 +0200
committerStefan Agner <stefan@agner.ch>2015-09-01 15:01:58 -0700
commite9c92de9aa17f1e97fc60a2428dee54057bad87a (patch)
treec12fd2f722982339eb81ea0b82836c0073e12602
parent11873ad008b1fbe1df9e290819901d8103b34c0a (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 af105a80f6..4c75f247c3 100644
--- a/drivers/mtd/ubi/fastmap.c
+++ b/drivers/mtd/ubi/fastmap.c
@@ -364,6 +364,7 @@ static void unmap_peb(struct ubi_attach_info *ai, int pnum)
aeb = rb_entry(node2, struct ubi_ainf_peb, u.rb);
if (aeb->pnum == pnum) {
rb_erase(&aeb->u.rb, &av->root);
+ av->leb_count--;
kmem_cache_free(ai->aeb_slab_cache, aeb);
return;
}