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>
This commit is contained in:
Richard Weinberger 2014-10-24 15:22:05 +02:00
parent 68e3226bd4
commit ad3d6a05ee

View File

@ -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;
}