From: Richard Weinberger Date: Fri, 24 Oct 2014 13:22:05 +0000 (+0200) Subject: UBI: Fastmap: Fix leb_count unbalance X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=ad3d6a05ee45eebf68ff08da0d3f86251b530a27;p=sagit-ice-cold%2Fkernel_xiaomi_msm8998.git UBI: Fastmap: Fix leb_count unbalance If a LEB is unmapped we have to decrement leb_count as well. Signed-off-by: Richard Weinberger --- 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) 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; }