瀏覽代碼

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>
Richard Weinberger 11 年之前
父節點
當前提交
ad3d6a05ee
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      drivers/mtd/ubi/fastmap.c

+ 1 - 0
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);
 			aeb = rb_entry(node2, struct ubi_ainf_peb, u.rb);
 			if (aeb->pnum == pnum) {
 			if (aeb->pnum == pnum) {
 				rb_erase(&aeb->u.rb, &av->root);
 				rb_erase(&aeb->u.rb, &av->root);
+				av->leb_count--;
 				kmem_cache_free(ai->aeb_slab_cache, aeb);
 				kmem_cache_free(ai->aeb_slab_cache, aeb);
 				return;
 				return;
 			}
 			}