aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mtd/ubi/wl.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c
index da7b44998b40..1f9f5f7a5d0f 100644
--- a/drivers/mtd/ubi/wl.c
+++ b/drivers/mtd/ubi/wl.c
@@ -679,7 +679,13 @@ static struct ubi_wl_entry *get_peb_for_wl(struct ubi_device *ubi)
679#else 679#else
680static struct ubi_wl_entry *get_peb_for_wl(struct ubi_device *ubi) 680static struct ubi_wl_entry *get_peb_for_wl(struct ubi_device *ubi)
681{ 681{
682 return find_wl_entry(ubi, &ubi->free, WL_FREE_MAX_DIFF); 682 struct ubi_wl_entry *e;
683
684 e = find_wl_entry(ubi, &ubi->free, WL_FREE_MAX_DIFF);
685 self_check_in_wl_tree(ubi, e, &ubi->free);
686 rb_erase(&e->u.rb, &ubi->free);
687
688 return e;
683} 689}
684 690
685int ubi_wl_get_peb(struct ubi_device *ubi) 691int ubi_wl_get_peb(struct ubi_device *ubi)