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

Commit a5b34c04 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mtd: ubi: Fix ubi free count calculation"

parents 5a2511eb 5c65854d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -689,6 +689,8 @@ static struct ubi_wl_entry *get_peb_for_wl(struct ubi_device *ubi)

	e = find_wl_entry(ubi, &ubi->free, WL_FREE_MAX_DIFF);
	self_check_in_wl_tree(ubi, e, &ubi->free);
	ubi->free_count--;
	ubi_assert(ubi->free_count >= 0);
	rb_erase(&e->u.rb, &ubi->free);

	return e;
@@ -1089,6 +1091,7 @@ static int wear_leveling_worker(struct ubi_device *ubi, struct ubi_work *wrk,

			/* Give the unused PEB back */
			wl_tree_add(e2, &ubi->free);
			ubi->free_count++;
			goto out_cancel;
		}
		self_check_in_wl_tree(ubi, e1, &ubi->used);