Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ad3d6a05 authored by Richard Weinberger's avatar Richard Weinberger
Browse files

UBI: Fastmap: Fix leb_count unbalance



If a LEB is unmapped we have to decrement leb_count as well.

Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
parent 68e3226b
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -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;
			}
			}